| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: mount_nfs.c,v 1.62 2008/07/20 01:20:22 lukem Exp $ */ | | 1 | /* $NetBSD: mount_nfs.c,v 1.63 2008/09/27 20:39:42 pooka Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1992, 1993, 1994 | | 4 | * Copyright (c) 1992, 1993, 1994 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Rick Macklem at The University of Guelph. | | 8 | * Rick Macklem at The University of Guelph. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -32,27 +32,27 @@ | | | @@ -32,27 +32,27 @@ |
32 | * SUCH DAMAGE. | | 32 | * SUCH DAMAGE. |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | #include <sys/cdefs.h> | | 35 | #include <sys/cdefs.h> |
36 | #ifndef lint | | 36 | #ifndef lint |
37 | __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\ | | 37 | __COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\ |
38 | The Regents of the University of California. All rights reserved."); | | 38 | The Regents of the University of California. All rights reserved."); |
39 | #endif /* not lint */ | | 39 | #endif /* not lint */ |
40 | | | 40 | |
41 | #ifndef lint | | 41 | #ifndef lint |
42 | #if 0 | | 42 | #if 0 |
43 | static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95"; | | 43 | static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95"; |
44 | #else | | 44 | #else |
45 | __RCSID("$NetBSD: mount_nfs.c,v 1.62 2008/07/20 01:20:22 lukem Exp $"); | | 45 | __RCSID("$NetBSD: mount_nfs.c,v 1.63 2008/09/27 20:39:42 pooka Exp $"); |
46 | #endif | | 46 | #endif |
47 | #endif /* not lint */ | | 47 | #endif /* not lint */ |
48 | | | 48 | |
49 | #include <sys/param.h> | | 49 | #include <sys/param.h> |
50 | #include <sys/mount.h> | | 50 | #include <sys/mount.h> |
51 | #include <sys/socket.h> | | 51 | #include <sys/socket.h> |
52 | #include <sys/stat.h> | | 52 | #include <sys/stat.h> |
53 | #include <syslog.h> | | 53 | #include <syslog.h> |
54 | | | 54 | |
55 | #ifdef ISO | | 55 | #ifdef ISO |
56 | #include <netiso/iso.h> | | 56 | #include <netiso/iso.h> |
57 | #endif | | 57 | #endif |
58 | | | 58 | |
| @@ -146,27 +146,27 @@ struct nfs_args nfsdefargs = { | | | @@ -146,27 +146,27 @@ struct nfs_args nfsdefargs = { |
146 | NFSMNT_NFSV3|NFSMNT_NOCONN|NFSMNT_RESVPORT, | | 146 | NFSMNT_NFSV3|NFSMNT_NOCONN|NFSMNT_RESVPORT, |
147 | NFS_WSIZE, | | 147 | NFS_WSIZE, |
148 | NFS_RSIZE, | | 148 | NFS_RSIZE, |
149 | NFS_READDIRSIZE, | | 149 | NFS_READDIRSIZE, |
150 | 10, | | 150 | 10, |
151 | NFS_RETRANS, | | 151 | NFS_RETRANS, |
152 | NFS_MAXGRPS, | | 152 | NFS_MAXGRPS, |
153 | NFS_DEFRAHEAD, | | 153 | NFS_DEFRAHEAD, |
154 | 0, /* Ignored; lease term */ | | 154 | 0, /* Ignored; lease term */ |
155 | NFS_DEFDEADTHRESH, | | 155 | NFS_DEFDEADTHRESH, |
156 | (char *)0, | | 156 | (char *)0, |
157 | }; | | 157 | }; |
158 | | | 158 | |
159 | int retrycnt = 0; | | 159 | int retrycnt = DEF_RETRY; |
160 | int opflags = 0; | | 160 | int opflags = 0; |
161 | int force2 = 0; | | 161 | int force2 = 0; |
162 | int force3 = 0; | | 162 | int force3 = 0; |
163 | int mnttcp_ok = 1; | | 163 | int mnttcp_ok = 1; |
164 | int port = 0; | | 164 | int port = 0; |
165 | | | 165 | |
166 | static void shownfsargs(const struct nfs_args *); | | 166 | static void shownfsargs(const struct nfs_args *); |
167 | #ifdef ISO | | 167 | #ifdef ISO |
168 | static struct iso_addr *iso_addr(const char *); | | 168 | static struct iso_addr *iso_addr(const char *); |
169 | #endif | | 169 | #endif |
170 | int mount_nfs(int argc, char **argv); | | 170 | int mount_nfs(int argc, char **argv); |
171 | /* void set_rpc_maxgrouplist(int); */ | | 171 | /* void set_rpc_maxgrouplist(int); */ |
172 | static void usage(void); | | 172 | static void usage(void); |
| @@ -179,27 +179,26 @@ main(int argc, char **argv) | | | @@ -179,27 +179,26 @@ main(int argc, char **argv) |
179 | } | | 179 | } |
180 | #endif | | 180 | #endif |
181 | | | 181 | |
182 | int | | 182 | int |
183 | mount_nfs(int argc, char *argv[]) | | 183 | mount_nfs(int argc, char *argv[]) |
184 | { | | 184 | { |
185 | int c, retval; | | 185 | int c, retval; |
186 | struct nfs_args *nfsargsp; | | 186 | struct nfs_args *nfsargsp; |
187 | struct nfs_args nfsargs; | | 187 | struct nfs_args nfsargs; |
188 | struct sockaddr_storage sa; | | 188 | struct sockaddr_storage sa; |
189 | int mntflags, altflags, num; | | 189 | int mntflags, altflags, num; |
190 | char name[MAXPATHLEN], *p, *spec; | | 190 | char name[MAXPATHLEN], *p, *spec; |
191 | mntoptparse_t mp; | | 191 | mntoptparse_t mp; |
192 | retrycnt = DEF_RETRY; | | | |
193 | | | 192 | |
194 | mntflags = 0; | | 193 | mntflags = 0; |
195 | altflags = 0; | | 194 | altflags = 0; |
196 | nfsargs = nfsdefargs; | | 195 | nfsargs = nfsdefargs; |
197 | nfsargsp = &nfsargs; | | 196 | nfsargsp = &nfsargs; |
198 | while ((c = getopt(argc, argv, | | 197 | while ((c = getopt(argc, argv, |
199 | "23a:bcCdD:g:I:iKL:lm:o:PpqR:r:sTt:w:x:UX")) != -1) | | 198 | "23a:bcCdD:g:I:iKL:lm:o:PpqR:r:sTt:w:x:UX")) != -1) |
200 | switch (c) { | | 199 | switch (c) { |
201 | case '3': | | 200 | case '3': |
202 | case 'q': | | 201 | case 'q': |
203 | if (force2) | | 202 | if (force2) |
204 | errx(1, "conflicting version options"); | | 203 | errx(1, "conflicting version options"); |
205 | force3 = 1; | | 204 | force3 = 1; |