summaryrefslogtreecommitdiff
path: root/sbin/mknod
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1998-07-06 07:06:15 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1998-07-06 07:06:15 +0000
commitfbb3447f9ccf8f81993d09bb10afa06fc715e02f (patch)
treed0edc879f62b2e4caa34920202fbf38d35bd59e3 /sbin/mknod
parent23b5892f5e3a21699ad309d3d3c8e06e89d3fa1a (diff)
downloadsrc-test2-fbb3447f9ccf8f81993d09bb10afa06fc715e02f.tar.gz
src-test2-fbb3447f9ccf8f81993d09bb10afa06fc715e02f.zip
Remove unused #include. Add usage().
Notes
Notes: svn path=/head/; revision=37422
Diffstat (limited to 'sbin/mknod')
-rw-r--r--sbin/mknod/mknod.85
-rw-r--r--sbin/mknod/mknod.c22
2 files changed, 15 insertions, 12 deletions
diff --git a/sbin/mknod/mknod.8 b/sbin/mknod/mknod.8
index ebcc86f8e02c..0c6d5c605e96 100644
--- a/sbin/mknod/mknod.8
+++ b/sbin/mknod/mknod.8
@@ -30,6 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mknod.8 8.2 (Berkeley) 12/11/93
+.\" $Id$
.\"
.Dd December 11, 1993
.Dt MKNOD 8
@@ -49,13 +50,13 @@ command creates device special files.
Normally the shell script
.Pa /dev/MAKEDEV
is used to create special files for commonly known devices; it executes
-.Nm mknod
+.Nm
with the appropriate arguments and can make all the files required for the
device.
.Pp
To make nodes manually, the four required arguments are:
.Pp
-.Bl -tag -width majorx
+.Bl -tag -width indent
.It Ar name
Device name, for example
.Dq sd
diff --git a/sbin/mknod/mknod.c b/sbin/mknod/mknod.c
index 21f63db1120e..fc2192f35148 100644
--- a/sbin/mknod/mknod.c
+++ b/sbin/mknod/mknod.c
@@ -43,21 +43,26 @@ static const char copyright[] =
#ifndef lint
#if 0
static char sccsid[] = "@(#)mknod.c 8.1 (Berkeley) 6/5/93";
-#else
-static const char rcsid[] =
- "$Id: mknod.c,v 1.6 1997/03/12 19:03:40 bde Exp $";
#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
#include <sys/stat.h>
+#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
-#include <err.h>
+
+static void
+usage()
+{
+ (void)fprintf(stderr, "usage: mknod name [b | c] major minor\n");
+ exit(1);
+}
int
main(argc, argv)
@@ -70,11 +75,8 @@ main(argc, argv)
mode_t mode;
int range_error;
- if (argc != 5) {
- (void)fprintf(stderr,
- "usage: mknod name [b | c] major minor\n");
- exit(1);
- }
+ if (argc != 5)
+ usage();
mode = 0666;
if (argv[2][0] == 'c')