summaryrefslogtreecommitdiff
path: root/sbin/swapon
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2011-10-25 17:10:15 +0000
committerEd Schouten <ed@FreeBSD.org>2011-10-25 17:10:15 +0000
commitce458f4239932351a2cf0fe31ad49015a342d1b2 (patch)
tree96ac46995bf1d35124364e028061cce8d1c3cb34 /sbin/swapon
parent41f2f866d09406ec693a8a6828178e6ebb1dab72 (diff)
downloadsrc-test2-ce458f4239932351a2cf0fe31ad49015a342d1b2.tar.gz
src-test2-ce458f4239932351a2cf0fe31ad49015a342d1b2.zip
Notes
Diffstat (limited to 'sbin/swapon')
-rw-r--r--sbin/swapon/Makefile1
-rw-r--r--sbin/swapon/swapon.c10
2 files changed, 5 insertions, 6 deletions
diff --git a/sbin/swapon/Makefile b/sbin/swapon/Makefile
index 74422811b4a5..6f8e8df2e5a6 100644
--- a/sbin/swapon/Makefile
+++ b/sbin/swapon/Makefile
@@ -8,7 +8,6 @@ LINKS+= ${BINDIR}/swapon ${BINDIR}/swapctl
MLINKS= swapon.8 swapoff.8
MLINKS+=swapon.8 swapctl.8
-WARNS?= 3
DPADD= ${LIBUTIL}
LDADD= -lutil
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c
index 5e85602aaf5c..ed13dc584426 100644
--- a/sbin/swapon/swapon.c
+++ b/sbin/swapon/swapon.c
@@ -67,7 +67,7 @@ main(int argc, char **argv)
{
struct fstab *fsp;
char *ptr;
- int stat;
+ int ret;
int ch, doall;
int sflag = 0, lflag = 0, hflag = 0, qflag = 0;
const char *etc_fstab;
@@ -144,7 +144,7 @@ main(int argc, char **argv)
}
argv += optind;
- stat = 0;
+ ret = 0;
if (etc_fstab != NULL)
setfstab(etc_fstab);
if (which_prog == SWAPON || which_prog == SWAPOFF) {
@@ -155,7 +155,7 @@ main(int argc, char **argv)
if (strstr(fsp->fs_mntops, "noauto"))
continue;
if (swap_on_off(fsp->fs_spec, 1)) {
- stat = 1;
+ ret = 1;
} else {
if (!qflag) {
printf("%s: %sing %s as swap device\n",
@@ -170,7 +170,7 @@ main(int argc, char **argv)
usage();
for (; *argv; ++argv) {
if (swap_on_off(*argv, 0)) {
- stat = 1;
+ ret = 1;
} else if (orig_prog == SWAPCTL) {
printf("%s: %sing %s as swap device\n",
getprogname(), which_prog == SWAPOFF ? "remov" : "add",
@@ -183,7 +183,7 @@ main(int argc, char **argv)
else
usage();
}
- exit(stat);
+ exit(ret);
}
static int