diff options
author | charnier <charnier@FreeBSD.org> | 1998-08-03 06:44:46 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1998-08-03 06:44:46 +0000 |
commit | 4d4ca48c8596d66cc9f4b94f613b1064a2fca8ae (patch) | |
tree | 7ab15743ff8419e1e0d39d3084a1a105a4552346 /sbin/umount | |
parent | 0fc51bafab7d1b8a8a7946d36f1cd278730b9309 (diff) | |
download | FreeBSD-src-4d4ca48c8596d66cc9f4b94f613b1064a2fca8ae.zip FreeBSD-src-4d4ca48c8596d66cc9f4b94f613b1064a2fca8ae.tar.gz |
Use errx() instead of err() for malloc failures. -Wall. Do not dot
terminate errx() string. Remove unused #includes. Use .Tn for NFS.
Diffstat (limited to 'sbin/umount')
-rw-r--r-- | sbin/umount/umount.8 | 8 | ||||
-rw-r--r-- | sbin/umount/umount.c | 19 |
2 files changed, 14 insertions, 13 deletions
diff --git a/sbin/umount/umount.8 b/sbin/umount/umount.8 index edab0ba..a00c05d 100644 --- a/sbin/umount/umount.8 +++ b/sbin/umount/umount.8 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 -.\" $Id$ +.\" $Id: umount.8,v 1.4 1997/08/20 11:40:13 steve Exp $ .\" .Dd May 8, 1995 .Dt UMOUNT 8 @@ -39,7 +39,7 @@ .Nm umount .Nd unmount filesystems .Sh SYNOPSIS -.Nm +.Nm umount .Op Fl fv .Ar special \&| node .Nm umount @@ -86,7 +86,9 @@ This option implies the .Fl A option and, unless otherwise specified with the .Fl t -option, will only unmount NFS filesystems. +option, will only unmount +.Tn NFS +filesystems. .It Fl t Ar type Is used to indicate the actions should only be taken on filesystems of the specified type. diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index 4c9da5a..f6d2392 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -32,26 +32,25 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1980, 1989, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint +#if 0 static char sccsid[] = "@(#)umount.c 8.8 (Berkeley) 5/8/95"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include <sys/param.h> #include <sys/stat.h> #include <sys/mount.h> -#include <sys/time.h> -#include <sys/socket.h> -#include <sys/socketvar.h> #include <netdb.h> #include <rpc/rpc.h> -#include <rpc/pmap_clnt.h> -#include <rpc/pmap_prot.h> #include <nfs/rpcv2.h> #include <err.h> @@ -109,7 +108,7 @@ main(argc, argv) break; case 't': if (typelist != NULL) - errx(1, "only one -t option may be specified."); + errx(1, "only one -t option may be specified"); typelist = makevfslist(optarg); break; case 'v': @@ -122,7 +121,7 @@ main(argc, argv) argc -= optind; argv += optind; - if (argc == 0 && !all || argc != 0 && all) + if ((argc == 0 && !all) || (argc != 0 && all)) usage(); /* -h implies "-t nfs" if no -t flag. */ @@ -162,7 +161,7 @@ umountall(typelist) char **typelist; { struct fstab *fs; - int rval, type; + int rval; char *cp; struct vfsconf vfc; @@ -192,7 +191,7 @@ umountall(typelist) * in some allocated memory, and then call recursively. */ if ((cp = malloc((size_t)strlen(fs->fs_file) + 1)) == NULL) - err(1, NULL); + errx(1, "malloc failed"); (void)strcpy(cp, fs->fs_file); rval = umountall(typelist); return (umountfs(cp, typelist) || rval); |