Use errx() instead of err() for malloc failures. -Wall. Do not dot

terminate errx() string. Remove unused #includes. Use .Tn for NFS.
This commit is contained in:
Philippe Charnier 1998-08-03 06:44:46 +00:00
parent 8679b1b4d8
commit adb378ce60
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=38041
2 changed files with 14 additions and 13 deletions

View File

@ -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.

View File

@ -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);