summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2007-03-16 17:08:04 +1100
committerNeil Brown <neilb@suse.de>2007-03-16 17:08:04 +1100
commit4af6588d57ab60454500b6789c87586bf0f69fe3 (patch)
treed811ba63f0865e6ca3a52069ff80fd8dca481c3a
parent16bda5364478e0b2d00ec3dc0ac534d775ab37bb (diff)
downloadnfs-utils-4af6588d57ab60454500b6789c87586bf0f69fe3.tar.gz
nfs-utils-4af6588d57ab60454500b6789c87586bf0f69fe3.tar.xz
nfs-utils-4af6588d57ab60454500b6789c87586bf0f69fe3.zip
Return the correct exit status on failed mounts
Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
-rw-r--r--utils/mount/mount.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index 7d58ef6..72cb89d 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -392,19 +392,25 @@ int main(int argc, char *argv[])
start_statd();
}
- if (!mnt_err && !fake) {
- 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 (fake)
+ return 0;
+ if (mnt_err)
+ exit(EX_FAIL);
- if(!nomtab)
- add_mtab(spec, mount_point, nfs_mount_vers == 4 ? "nfs4" : "nfs",
- flags, extra_opts, 0, 0);
+ 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;
}