svn commit: trunk/busybox/util-linux

vda at busybox.net vda at busybox.net
Mon Mar 12 18:16:25 UTC 2007


Author: vda
Date: 2007-03-12 11:16:24 -0700 (Mon, 12 Mar 2007)
New Revision: 18072

Log:
swapon: random shrinkage


Modified:
   trunk/busybox/util-linux/swaponoff.c


Changeset:
Modified: trunk/busybox/util-linux/swaponoff.c
===================================================================
--- trunk/busybox/util-linux/swaponoff.c	2007-03-12 11:31:17 UTC (rev 18071)
+++ trunk/busybox/util-linux/swaponoff.c	2007-03-12 18:16:24 UTC (rev 18072)
@@ -11,7 +11,6 @@
 #include <mntent.h>
 #include <sys/swap.h>
 
-
 static int swap_enable_disable(char *device)
 {
 	int status;
@@ -19,10 +18,12 @@
 
 	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 @@
 	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 @@
 		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;




More information about the busybox-cvs mailing list