[PATCH] fix exit codes on ignore errors with -a

Tito farmatito at tiscali.it
Mon Mar 31 20:07:24 UTC 2014


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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swaponoff_exitcode_fix.patch
Type: text/x-patch
Size: 412 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140331/4eae1a41/attachment.bin>


More information about the busybox mailing list