Remove unused #include. Add usage().

This commit is contained in:
charnier 1998-07-06 07:06:15 +00:00
parent 1a59aba7b6
commit c1bbc8283c
2 changed files with 15 additions and 12 deletions

View File

@ -30,6 +30,7 @@
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" @(#)mknod.8 8.2 (Berkeley) 12/11/93 .\" @(#)mknod.8 8.2 (Berkeley) 12/11/93
.\" $Id$
.\" .\"
.Dd December 11, 1993 .Dd December 11, 1993
.Dt MKNOD 8 .Dt MKNOD 8
@ -49,13 +50,13 @@ command creates device special files.
Normally the shell script Normally the shell script
.Pa /dev/MAKEDEV .Pa /dev/MAKEDEV
is used to create special files for commonly known devices; it executes 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 with the appropriate arguments and can make all the files required for the
device. device.
.Pp .Pp
To make nodes manually, the four required arguments are: To make nodes manually, the four required arguments are:
.Pp .Pp
.Bl -tag -width majorx .Bl -tag -width indent
.It Ar name .It Ar name
Device name, for example Device name, for example
.Dq sd .Dq sd

View File

@ -43,21 +43,26 @@ static const char copyright[] =
#ifndef lint #ifndef lint
#if 0 #if 0
static char sccsid[] = "@(#)mknod.c 8.1 (Berkeley) 6/5/93"; 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 #endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <err.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include <err.h>
static void
usage()
{
(void)fprintf(stderr, "usage: mknod name [b | c] major minor\n");
exit(1);
}
int int
main(argc, argv) main(argc, argv)
@ -70,11 +75,8 @@ main(argc, argv)
mode_t mode; mode_t mode;
int range_error; int range_error;
if (argc != 5) { if (argc != 5)
(void)fprintf(stderr, usage();
"usage: mknod name [b | c] major minor\n");
exit(1);
}
mode = 0666; mode = 0666;
if (argv[2][0] == 'c') if (argv[2][0] == 'c')