| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: umount.c,v 1.46 2013/07/01 15:16:33 christos Exp $ */ | | 1 | /* $NetBSD: umount.c,v 1.47 2013/07/02 01:39:17 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1980, 1989, 1993 | | 4 | * Copyright (c) 1980, 1989, 1993 |
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 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -29,27 +29,27 @@ | | | @@ -29,27 +29,27 @@ |
29 | * SUCH DAMAGE. | | 29 | * SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | #ifndef lint | | 33 | #ifndef lint |
34 | __COPYRIGHT("@(#) Copyright (c) 1980, 1989, 1993\ | | 34 | __COPYRIGHT("@(#) Copyright (c) 1980, 1989, 1993\ |
35 | The Regents of the University of California. All rights reserved."); | | 35 | The Regents of the University of California. All rights reserved."); |
36 | #endif /* not lint */ | | 36 | #endif /* not lint */ |
37 | | | 37 | |
38 | #ifndef lint | | 38 | #ifndef lint |
39 | #if 0 | | 39 | #if 0 |
40 | static char sccsid[] = "@(#)umount.c 8.8 (Berkeley) 5/8/95"; | | 40 | static char sccsid[] = "@(#)umount.c 8.8 (Berkeley) 5/8/95"; |
41 | #else | | 41 | #else |
42 | __RCSID("$NetBSD: umount.c,v 1.46 2013/07/01 15:16:33 christos Exp $"); | | 42 | __RCSID("$NetBSD: umount.c,v 1.47 2013/07/02 01:39:17 christos Exp $"); |
43 | #endif | | 43 | #endif |
44 | #endif /* not lint */ | | 44 | #endif /* not lint */ |
45 | | | 45 | |
46 | #include <sys/param.h> | | 46 | #include <sys/param.h> |
47 | #include <sys/stat.h> | | 47 | #include <sys/stat.h> |
48 | #include <sys/mount.h> | | 48 | #include <sys/mount.h> |
49 | #include <sys/time.h> | | 49 | #include <sys/time.h> |
50 | #ifndef SMALL | | 50 | #ifndef SMALL |
51 | #include <sys/socket.h> | | 51 | #include <sys/socket.h> |
52 | | | 52 | |
53 | #include <netdb.h> | | 53 | #include <netdb.h> |
54 | #include <rpc/rpc.h> | | 54 | #include <rpc/rpc.h> |
55 | #include <rpc/pmap_clnt.h> | | 55 | #include <rpc/pmap_clnt.h> |
| @@ -173,30 +173,30 @@ main(int argc, char *argv[]) | | | @@ -173,30 +173,30 @@ main(int argc, char *argv[]) |
173 | errs = 1; | | 173 | errs = 1; |
174 | return errs; | | 174 | return errs; |
175 | } | | 175 | } |
176 | | | 176 | |
177 | static int | | 177 | static int |
178 | umountfs(const char *name, const char **typelist, int raw) | | 178 | umountfs(const char *name, const char **typelist, int raw) |
179 | { | | 179 | { |
180 | #ifndef SMALL | | 180 | #ifndef SMALL |
181 | enum clnt_stat clnt_stat; | | 181 | enum clnt_stat clnt_stat; |
182 | struct timeval try; | | 182 | struct timeval try; |
183 | CLIENT *clp; | | 183 | CLIENT *clp; |
184 | char *hostp = NULL; | | 184 | char *hostp = NULL; |
185 | struct addrinfo *ai = NULL, hints; | | 185 | struct addrinfo *ai = NULL, hints; |
| | | 186 | const char *proto = NULL; |
186 | #endif /* !SMALL */ | | 187 | #endif /* !SMALL */ |
187 | const char *mntpt; | | 188 | const char *mntpt; |
188 | char *type, rname[MAXPATHLEN]; | | 189 | char *type, rname[MAXPATHLEN]; |
189 | const char *proto = NULL; | | | |
190 | mntwhat what; | | 190 | mntwhat what; |
191 | struct stat sb; | | 191 | struct stat sb; |
192 | | | 192 | |
193 | if (raw) { | | 193 | if (raw) { |
194 | mntpt = name; | | 194 | mntpt = name; |
195 | } else { | | 195 | } else { |
196 | | | 196 | |
197 | what = MNTANY; | | 197 | what = MNTANY; |
198 | if (realpath(name, rname) != NULL) { | | 198 | if (realpath(name, rname) != NULL) { |
199 | name = rname; | | 199 | name = rname; |
200 | | | 200 | |
201 | if (stat(name, &sb) == 0) { | | 201 | if (stat(name, &sb) == 0) { |
202 | if (S_ISBLK(sb.st_mode)) | | 202 | if (S_ISBLK(sb.st_mode)) |