summaryrefslogtreecommitdiff
path: root/sbin/swapon
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2013-06-28 05:09:01 +0000
committerHiroki Sato <hrs@FreeBSD.org>2013-06-28 05:09:01 +0000
commitcb754f614f3c26a0435289d378ad7df4d7abbefe (patch)
tree98302f7d0093b0c201e2d36976ff6ff3938b4edb /sbin/swapon
parent7554303627b0c866d9be4ac649cd4feaa8886c24 (diff)
downloadsrc-test2-cb754f614f3c26a0435289d378ad7df4d7abbefe.tar.gz
src-test2-cb754f614f3c26a0435289d378ad7df4d7abbefe.zip
Fix build.
Spotted by: gjb
Notes
Notes: svn path=/head/; revision=252332
Diffstat (limited to 'sbin/swapon')
-rw-r--r--sbin/swapon/swapon.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c
index 55beb5b1fc20..84c9b42304a4 100644
--- a/sbin/swapon/swapon.c
+++ b/sbin/swapon/swapon.c
@@ -248,11 +248,11 @@ swap_on_off_gbde(char *name, int doingall)
{
const char *ret;
char pass[64 * 2 + 1], bpass[64];
- char *devname, *p;
+ char *dname, *p;
int i, fd, error;
- devname = strdup(name);
- p = strrchr(devname, '.');
+ dname = strdup(name);
+ p = strrchr(dname, '.');
if (p == NULL) {
warnx("%s: Malformed device name", name);
return (NULL);
@@ -268,7 +268,7 @@ swap_on_off_gbde(char *name, int doingall)
pass[sizeof(pass) - 1] = '\0';
error = run_cmd(&fd, "%s init %s -P %s", _PATH_GBDE,
- devname, pass);
+ dname, pass);
if (error) {
/* bde device found. Ignore it. */
close(fd);
@@ -278,7 +278,7 @@ swap_on_off_gbde(char *name, int doingall)
}
close(fd);
error = run_cmd(&fd, "%s attach %s -p %s", _PATH_GBDE,
- devname, pass);
+ dname, pass);
if (error) {
close(fd);
warnx("gbde (attach) error: %s", name);
@@ -298,11 +298,11 @@ swap_on_off_gbde(char *name, int doingall)
fd = -1;
switch (which_prog) {
case SWAPOFF:
- error = run_cmd(&fd, "%s detach %s", _PATH_GBDE, devname);
+ error = run_cmd(&fd, "%s detach %s", _PATH_GBDE, dname);
if (error) {
/* bde device not found. Ignore it. */
if (!qflag)
- warnx("%s: Device not found", devname);
+ warnx("%s: Device not found", dname);
return (NULL);
}
break;
@@ -320,14 +320,14 @@ static const char *
swap_on_off_geli(char *name, char *mntops, int doingall)
{
const char *ops, *aalgo, *ealgo, *keylen_str, *sectorsize_str;
- char *devname, *p;
+ char *dname, *p;
char args[4096];
struct stat sb;
int fd, error, keylen, sectorsize;
u_long ul;
- devname = strdup(name);
- p = strrchr(devname, '.');
+ dname = strdup(name);
+ p = strrchr(dname, '.');
if (p == NULL) {
warnx("%s: Malformed device name", name);
return (NULL);
@@ -397,7 +397,7 @@ swap_on_off_geli(char *name, char *mntops, int doingall)
switch (which_prog) {
case SWAPON:
error = run_cmd(&fd, "%s onetime %s %s", _PATH_GELI, args,
- devname);
+ dname);
if (error) {
/* eli device found. Ignore it. */
close(fd);