]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/nfs4mount.c
mount.nfs: Assume v2/v3 if mount-related options are present
[nfs-utils.git] / utils / mount / nfs4mount.c
index af70551f595e696a01a2a9bfbe98a53a1f87736d..a2f318fa47da13b3af4885ee514bd7d6e1fc7703 100644 (file)
@@ -34,6 +34,7 @@
 #include <arpa/inet.h>
 #include <rpc/auth.h>
 #include <rpc/rpc.h>
+
 #ifdef HAVE_RPCSVC_NFS_PROT_H
 #include <rpcsvc/nfs_prot.h>
 #else
@@ -45,6 +46,7 @@
 #include "nls.h"
 #include "xcommon.h"
 
+#include "mount.h"
 #include "mount_constants.h"
 #include "nfs4_mount.h"
 #include "nfs_mount.h"
@@ -188,10 +190,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 +444,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);