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>
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);
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);