X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnfs4mount.c;h=028e7cd5447e16a8b20e50efa67ec703cca3f3d6;hp=a2f318fa47da13b3af4885ee514bd7d6e1fc7703;hb=9a5293a10551c03b4fb976503dd24da569fcadb3;hpb=ac06221bedbae2238e38fb8905e0234432ab7a14 diff --git a/utils/mount/nfs4mount.c b/utils/mount/nfs4mount.c index a2f318f..028e7cd 100644 --- a/utils/mount/nfs4mount.c +++ b/utils/mount/nfs4mount.c @@ -146,7 +146,7 @@ static int fill_ipv4_sockaddr(const char *hostname, struct sockaddr_in *addr) progname, hostname); return -1; } - if (hp->h_length > sizeof(struct in_addr)) { + if (hp->h_length > (int)sizeof(struct in_addr)) { nfs_error(_("%s: got bad hp->h_length"), progname); hp->h_length = sizeof(struct in_addr); } @@ -217,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. @@ -434,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) {