X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fmount%2Fnfs4mount.c;h=4a2fab7dfabf326f268b31952275583a23004d05;hb=19c786fc87aba2ecae3072d54ca0a994d5bb997b;hp=2b0fe2e30c50de63b1a2c92b2ef69440e6760c06;hpb=281ca299724f24e7b19c1eca04bba03410e2a306;p=nfs-utils.git diff --git a/utils/mount/nfs4mount.c b/utils/mount/nfs4mount.c index 2b0fe2e..4a2fab7 100644 --- a/utils/mount/nfs4mount.c +++ b/utils/mount/nfs4mount.c @@ -34,6 +34,7 @@ #include #include #include + #ifdef HAVE_RPCSVC_NFS_PROT_H #include #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" @@ -215,8 +217,11 @@ int nfs4mount(const char *spec, const char *node, int flags, progname); goto fail; } - snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s", - old_opts, *old_opts ? "," : "", s); + if (running_bg) + strncpy(new_opts, old_opts, sizeof(new_opts)); + else + snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s", + old_opts, *old_opts ? "," : "", s); *extra_opts = xstrdup(new_opts); /* Set default options. @@ -432,15 +437,17 @@ int nfs4mount(const char *spec, const char *node, int flags, break; } - switch(rpc_createerr.cf_stat){ - case RPC_TIMEDOUT: - break; - case RPC_SYSTEMERROR: - if (errno == ETIMEDOUT) + if (!bg) { + switch(rpc_createerr.cf_stat) { + case RPC_TIMEDOUT: break; - default: - rpc_mount_errors(hostname, 0, bg); - goto fail; + case RPC_SYSTEMERROR: + if (errno == ETIMEDOUT) + break; + default: + rpc_mount_errors(hostname, 0, bg); + goto fail; + } } if (bg && !running_bg) {