[arch-projects] [initscripts] [PATCH 15/17] netfs: Simplify error handling

Kurt J. Bosch kjb-temp-2009 at alpenjodel.de
Tue Jul 5 18:02:27 EDT 2011


---
 netfs |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/netfs b/netfs
index 7ca59ab..c2fcfc9 100755
--- a/netfs
+++ b/netfs
@@ -4,15 +4,13 @@
 . /etc/rc.conf
 . /etc/rc.d/functions
 
-rc=0
-
 case "$1" in
 	start)
 		stat_busy "Mounting Network Filesystems"
 		mount -a -t nfs,nfs4,smbfs,codafs,ncpfs,cifs,shfs,glusterfs,fuse,fuseblk,fuse.glusterfs,davfs
 		rc=$?
 		mount -a -O _netdev
-		if ((rc + $? > 0)); then
+		if (( rc || $? )); then
 			stat_fail
 		else
 			add_daemon netfs
@@ -24,7 +22,7 @@ case "$1" in
 		umount -a -O _netdev
 		rc=$?
 		umount -a -t nfs,nfs4,smbfs,codafs,ncpfs,cifs,shfs,glusterfs,fuse,fuseblk,fuse.glusterfs,davfs
-		if ((rc + $? > 0)); then
+		if (( rc || $? )); then
 			stat_fail
 		else
 			rm_daemon netfs
-- 
1.7.1



More information about the arch-projects mailing list