Hi,
this patch fixes a minor error on exit codes in swapon/swapoff
when the -a switch is set: real swapon/swapoff -a  returns 0
on ignored errors.

Ciao,
Tito

--- util-linux/swaponoff.c.orig 2014-03-31 21:59:08.000000000 +0200
+++ util-linux/swaponoff.c      2014-03-31 21:59:50.490560746 +0200
@@ -116,9 +116,8 @@
                }
        }
 
-       if (err) {
-               if (!quiet)
-                       bb_simple_perror_msg(device);
+       if (err && !quiet) {
+               bb_simple_perror_msg(device);
                return 1;
        }
        return 0;
Real swapon/swapoff -a returns 0 on ignored errors.

Signed-off by Tito Ragusa <[email protected]>

--- util-linux/swaponoff.c.orig	2014-03-31 21:59:08.000000000 +0200
+++ util-linux/swaponoff.c	2014-03-31 21:59:50.490560746 +0200
@@ -116,9 +116,8 @@
 		}
 	}
 
-	if (err) {
-		if (!quiet)
-			bb_simple_perror_msg(device);
+	if (err && !quiet) {
+		bb_simple_perror_msg(device);
 		return 1;
 	}
 	return 0;
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to