~ubuntu-branches/debian/stretch/nfs-utils/stretch

« back to all changes in this revision

Viewing changes to .pc/13-preserve-explicit-port-2049.patch/utils/mount/stropts.c

  • Committer: Bazaar Package Importer
  • Author(s): Luk Claes
  • Date: 2011-07-09 16:28:32 UTC
  • mfrom: (1.2.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20110709162832-ovaehe77pm3hyy35
Tags: 1:1.2.4-1
* New upstream version
  - Fix host_reliable_addrinfo (Closes: #633155)
  - Allow multiple RPC listeners to share listener port number
  (Closes: #619877)
  - Add --enable-libmount-mount (Closes: #626478)
  - 12-svcgssd-document-n-option.patch applied upstream
  - Refresh 19-exports.man-Fix-comment-syntax.patch
  - 21-anticipate-RLIMIT_FSIZE.patch applied upstream
  - Add nfsidmap binary and manpage
  - Use autoreconf to avoid build failure

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
#include "parse_dev.h"
50
50
#include "conffile.h"
51
51
 
52
 
#ifndef HAVE_DECL_AI_ADDRCONFIG
53
 
#define AI_ADDRCONFIG   0
54
 
#endif
55
 
 
56
52
#ifndef NFS_PROGRAM
57
53
#define NFS_PROGRAM     (100003)
58
54
#endif
114
110
        }
115
111
}
116
112
#else
117
 
inline void nfs_default_version(struct nfsmount_info *mi) {}
 
113
inline void nfs_default_version(__attribute__ ((unused)) struct nfsmount_info *mi) {}
118
114
#endif /* MOUNT_CONFIG */
119
115
 
120
116
/*
123
119
 * Returns a time_t timeout timestamp, in seconds.
124
120
 */
125
121
static time_t nfs_parse_retry_option(struct mount_options *options,
126
 
                                     unsigned int timeout_minutes)
 
122
                                     const time_t default_timeout)
127
123
{
 
124
        time_t timeout_minutes;
128
125
        long tmp;
129
126
 
 
127
        timeout_minutes = default_timeout;
130
128
        switch (po_get_numeric(options, "retry", &tmp)) {
131
129
        case PO_NOT_FOUND:
132
130
                break;
135
133
                        timeout_minutes = tmp;
136
134
                        break;
137
135
                }
 
136
                /*FALLTHROUGH*/
138
137
        case PO_BAD_VALUE:
139
138
                if (verbose)
140
139
                        nfs_error(_("%s: invalid retry timeout was specified; "
142
141
                break;
143
142
        }
144
143
 
145
 
        return time(NULL) + (time_t)(timeout_minutes * 60);
 
144
        return time(NULL) + (timeout_minutes * 60);
146
145
}
147
146
 
148
147
/*
343
342
{
344
343
        struct addrinfo hint = {
345
344
                .ai_protocol    = (int)IPPROTO_UDP,
346
 
                .ai_flags       = AI_ADDRCONFIG,
347
345
        };
348
346
        sa_family_t family;
349
347
        int error;
570
568
        char *options = NULL;
571
569
        int result;
572
570
 
 
571
        if (mi->fake)
 
572
                return 1;
 
573
 
573
574
        if (po_join(opts, &options) == PO_FAILED) {
574
575
                errno = EIO;
575
576
                return 0;
576
577
        }
577
578
 
578
 
        if (mi->fake)
579
 
                return 1;
580
 
 
581
579
        result = mount(mi->spec, mi->node, mi->type,
582
580
                        mi->flags & ~(MS_USER|MS_USERS), options);
 
581
        free(options);
 
582
 
583
583
        if (verbose && result) {
584
584
                int save = errno;
585
585
                nfs_error(_("%s: mount(2): %s"), progname, strerror(save));
650
650
static int nfs_try_mount_v3v2(struct nfsmount_info *mi)
651
651
{
652
652
        struct addrinfo *ai;
653
 
        int ret;
 
653
        int ret = 0;
654
654
 
655
655
        for (ai = mi->address; ai != NULL; ai = ai->ai_next) {
656
656
                ret = nfs_do_mount_v3v2(mi, ai->ai_addr, ai->ai_addrlen);
737
737
static int nfs_try_mount_v4(struct nfsmount_info *mi)
738
738
{
739
739
        struct addrinfo *ai;
740
 
        int ret;
 
740
        int ret = 0;
741
741
 
742
742
        for (ai = mi->address; ai != NULL; ai = ai->ai_next) {
743
743
                ret = nfs_do_mount_v4(mi, ai->ai_addr, ai->ai_addrlen);