aboutsummaryrefslogtreecommitdiff
path: root/sbin/umount
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1998-08-03 06:44:46 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1998-08-03 06:44:46 +0000
commitadb378ce6021e39f835e08071545d0d3c3b73042 (patch)
tree7067ca4f84a42910a85a7ced26914fb0042adec1 /sbin/umount
parent8679b1b4d8a7c79b6afeedaee07fd711578a190e (diff)
downloadsrc-adb378ce6021e39f835e08071545d0d3c3b73042.tar.gz
src-adb378ce6021e39f835e08071545d0d3c3b73042.zip
Use errx() instead of err() for malloc failures. -Wall. Do not dot
terminate errx() string. Remove unused #includes. Use .Tn for NFS.
Notes
Notes: svn path=/head/; revision=38041
Diffstat (limited to 'sbin/umount')
-rw-r--r--sbin/umount/umount.88
-rw-r--r--sbin/umount/umount.c19
2 files changed, 14 insertions, 13 deletions
diff --git a/sbin/umount/umount.8 b/sbin/umount/umount.8
index edab0ba9689c..a00c05dcf2c9 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 4c9da5a2d0ad..f6d2392246d7 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);