]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/stropts.c
mount: Fix compiler warning in nfs_parse_retry_option()
[nfs-utils.git] / utils / mount / stropts.c
index 50a1a2a06626a72ba2c09fe656df3331e66a85b1..29b1aaac39cff797e607c0350786687bb303bcb4 100644 (file)
 #include "parse_dev.h"
 #include "conffile.h"
 
-#ifndef HAVE_DECL_AI_ADDRCONFIG
-#define AI_ADDRCONFIG  0
-#endif
-
 #ifndef NFS_PROGRAM
 #define NFS_PROGRAM    (100003)
 #endif
@@ -123,10 +119,12 @@ inline void nfs_default_version(struct nfsmount_info *mi) {}
  * Returns a time_t timeout timestamp, in seconds.
  */
 static time_t nfs_parse_retry_option(struct mount_options *options,
-                                    unsigned int timeout_minutes)
+                                    const time_t default_timeout)
 {
+       time_t timeout_minutes;
        long tmp;
 
+       timeout_minutes = default_timeout;
        switch (po_get_numeric(options, "retry", &tmp)) {
        case PO_NOT_FOUND:
                break;
@@ -135,6 +133,7 @@ static time_t nfs_parse_retry_option(struct mount_options *options,
                        timeout_minutes = tmp;
                        break;
                }
+               /*FALLTHROUGH*/
        case PO_BAD_VALUE:
                if (verbose)
                        nfs_error(_("%s: invalid retry timeout was specified; "
@@ -142,7 +141,7 @@ static time_t nfs_parse_retry_option(struct mount_options *options,
                break;
        }
 
-       return time(NULL) + (time_t)(timeout_minutes * 60);
+       return time(NULL) + (timeout_minutes * 60);
 }
 
 /*
@@ -343,7 +342,6 @@ static int nfs_validate_options(struct nfsmount_info *mi)
 {
        struct addrinfo hint = {
                .ai_protocol    = (int)IPPROTO_UDP,
-               .ai_flags       = AI_ADDRCONFIG,
        };
        sa_family_t family;
        int error;