diff options
author | Jeff Layton <jlaton@redhat.com> | 2008-05-07 10:35:30 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2008-05-07 10:35:30 -0400 |
commit | 281ca299724f24e7b19c1eca04bba03410e2a306 (patch) | |
tree | 8e9227d4057a91a1bbc1f18c5902cca98e628e88 | |
parent | 5f7cc524008a7dc548a71f4c7b0d39759371a37a (diff) | |
download | nfs-utils-281ca299724f24e7b19c1eca04bba03410e2a306.tar.gz nfs-utils-281ca299724f24e7b19c1eca04bba03410e2a306.tar.xz nfs-utils-281ca299724f24e7b19c1eca04bba03410e2a306.zip |
The bg option is essentially ignored with nfs4 currently. nfs4mount()
will never exit with EX_BG, so the mount will never be backgrounded.
Fix it so that when bg is specified that we error out with EX_BG as
soon as possible after the first failed mount attempt.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/mount/nfs4mount.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/mount/nfs4mount.c b/utils/mount/nfs4mount.c index af70551..2b0fe2e 100644 --- a/utils/mount/nfs4mount.c +++ b/utils/mount/nfs4mount.c @@ -188,10 +188,9 @@ int nfs4mount(const char *spec, const char *node, int flags, int bg, soft, intr; int nocto, noac, unshared; int retry; - int retval; + int retval = EX_FAIL; time_t timeout, t; - retval = EX_FAIL; if (strlen(spec) >= sizeof(hostdir)) { nfs_error(_("%s: excessively long host:dir argument\n"), progname); @@ -443,6 +442,13 @@ int nfs4mount(const char *spec, const char *node, int flags, rpc_mount_errors(hostname, 0, bg); goto fail; } + + if (bg && !running_bg) { + if (retry > 0) + retval = EX_BG; + goto fail; + } + t = time(NULL); if (t >= timeout) { rpc_mount_errors(hostname, 0, bg); |