]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/nfs4mount.c
proper merge
[nfs-utils.git] / utils / mount / nfs4mount.c
index a2f318fa47da13b3af4885ee514bd7d6e1fc7703..028e7cd5447e16a8b20e50efa67ec703cca3f3d6 100644 (file)
@@ -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) {