summaryrefslogtreecommitdiff
path: root/util-linux/swaponoff.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-03-12 18:16:24 +0000
committerDenis Vlasenko2007-03-12 18:16:24 +0000
commitb3f09f4a5092aacbdc3da80d4fefeaf06445a4f8 (patch)
tree881fa2212e9166a4377eba16b1f8fc89704c3034 /util-linux/swaponoff.c
parent214aec46bd7b96a1afeeb17f1129260db8c6157f (diff)
downloadbusybox-b3f09f4a5092aacbdc3da80d4fefeaf06445a4f8.zip
busybox-b3f09f4a5092aacbdc3da80d4fefeaf06445a4f8.tar.gz
swapon: random shrinkage
Diffstat (limited to 'util-linux/swaponoff.c')
-rw-r--r--util-linux/swaponoff.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index e1de4eb..3a6afe2 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -11,7 +11,6 @@
#include <mntent.h>
#include <sys/swap.h>
-
static int swap_enable_disable(char *device)
{
int status;
@@ -19,10 +18,12 @@ static int swap_enable_disable(char *device)
xstat(device, &st);
+#ifdef BLOAT
/* test for holes */
if (S_ISREG(st.st_mode))
if (st.st_blocks * 512 < st.st_size)
bb_error_msg_and_die("swap file has holes");
+#endif
if (applet_name[5] == 'n')
status = swapon(device, 0);
@@ -57,8 +58,6 @@ static int do_em_all(void)
return err;
}
-#define DO_ALL 0x01
-
int swap_on_off_main(int argc, char **argv);
int swap_on_off_main(int argc, char **argv)
{
@@ -68,10 +67,10 @@ int swap_on_off_main(int argc, char **argv)
bb_show_usage();
ret = getopt32(argc, argv, "a");
- if (ret & DO_ALL)
+ if (ret)
return do_em_all();
- ret = 0;
+ /* ret = 0; redundant */
while (*++argv)
ret += swap_enable_disable(*argv);
return ret;