Skip to contentSkip to conversation

nfs-utils: mount:Fixed exit status

PATCH In review Steve Dickson 1 participant 1 message Feb 26, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/11 nfs-utils: mount:Fixed exit status

commit 200d810e3fa2c7f35932faac87a6409fac5a9d4d

Author: Steve Dickson <[email protected]>
Date:   Sat Feb 24 15:21:52 2007 -0500

Return the correct exit status on failed mounts

utils/mount/mount.c +16 -13
index 13bffbc..8440055 100644
@@ -472,21 +472,24 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	if (!mnt_err && !fake) {
-		if(!(flags & MS_REMOUNT)) {
-			mnt_err = do_mount_syscall(spec, mount_point,
-					nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
-		
-			if(mnt_err) {
-				mount_error(mount_point);
-				exit(-1);
-			}
-		}
-		if(!nomtab) {
-			add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
-				 flags, extra_opts, 0, 0);
+	if (fake)
+		return 0;
+	if (mnt_err)
+		exit(EX_FAIL);
+
+	if(!(flags & MS_REMOUNT)) {
+		mnt_err = do_mount_syscall(spec, mount_point,
+				nfs_mount_vers == 4 ? "nfs4" : "nfs", flags, mount_opts);
+
+		if(mnt_err) {
+			mount_error(mount_point);
+			exit(EX_FAIL);
 		}
 	}
+	if(!nomtab) {
+		add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
+			 flags, extra_opts, 0, 0);
+	}
 
 	return 0;
 }

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs