From adb378ce6021e39f835e08071545d0d3c3b73042 Mon Sep 17 00:00:00 2001 From: Philippe Charnier Date: Mon, 3 Aug 1998 06:44:46 +0000 Subject: [PATCH] Use errx() instead of err() for malloc failures. -Wall. Do not dot terminate errx() string. Remove unused #includes. Use .Tn for NFS. --- sbin/umount/umount.8 | 8 +++++--- 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 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 #include #include -#include -#include -#include #include #include -#include -#include #include #include @@ -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);