summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-04-24 17:35:05 -0400
committerTom Gundersen <teg@jklm.no>2011-04-30 21:10:40 +0200
commitbcbcea89b153aed0c905201c14ea3d3e3a1ee043 (patch)
treeea796adc2288bd996fd2ff7b4d7f2b0ae0c1e07f
parente0153f33ea46d23da4add5409b344e3cc050c6cc (diff)
rc: exit with error count, not error sum
cc199761f assumes that /etc/rc.d scripts will exit with a value of 0 or 1. Since this can't be guaranteed, clamp the return value to 0 or 1 before adding it to the exit value. Note that a lot of /etc/rc.d scripts don't properly exit with 0 or 1, so this is more of a forward looking change in the hope that these scripts are cleaned up. Signed-off-by: Tom Gundersen <teg@jklm.no>
-rwxr-xr-xrc2
1 files changed, 1 insertions, 1 deletions
diff --git a/rc b/rc
index 1e64119..54dc11c 100755
--- a/rc
+++ b/rc
@@ -45,7 +45,7 @@ case $1 in
shift
for i; do
[[ -x "/etc/rc.d/$i" ]] && "/etc/rc.d/$i" $action
- (( ret += $? ))
+ (( ret += !! $? )) # clamp exit value to 0/1
done
esac