]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/stropts.c
text-based mount: Retry when server can't be reached
[nfs-utils.git] / utils / mount / stropts.c
index 9a13509961adeab01c221f57ebeae2d1a21dcd15..74224ffdad2a0e477b65b05748384c2d3d51f279 100644 (file)
@@ -35,6 +35,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#include "sockaddr.h"
 #include "xcommon.h"
 #include "mount.h"
 #include "nls.h"
@@ -77,12 +78,6 @@ extern char *progname;
 extern int verbose;
 extern int sloppy;
 
-union nfs_sockaddr {
-       struct sockaddr         sa;
-       struct sockaddr_in      s4;
-       struct sockaddr_in6     s6;
-};
-
 struct nfsmount_info {
        const char              *spec,          /* server:/path */
                                *node,          /* mounted-on dir */
@@ -520,6 +515,10 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options)
        if (!nfs_probe_bothports(mnt_saddr, mnt_salen, &mnt_pmap,
                                 nfs_saddr, nfs_salen, &nfs_pmap)) {
                errno = ESPIPE;
+               if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED)
+                       errno = EOPNOTSUPP;
+               else if (rpc_createerr.cf_error.re_errno != 0)
+                       errno = rpc_createerr.cf_error.re_errno;
                return 0;
        }