From 6161f25abc10361251f77bfd3c69ea370e83d82d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 9 Nov 1995 23:49:53 +0000 Subject: (main): Move to the end. Remove fwd dcls. --- src/mknod.c | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'src/mknod.c') diff --git a/src/mknod.c b/src/mknod.c index e21c66d36..30989bcce 100644 --- a/src/mknod.c +++ b/src/mknod.c @@ -38,8 +38,6 @@ #include "error.h" #include "xstrtol.h" -static void usage (int status); - /* The name this program was run with. */ char *program_name; @@ -57,6 +55,31 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; +static void +usage (int status) +{ + if (status != 0) + fprintf (stderr, "Try `%s --help' for more information.\n", + program_name); + else + { + printf ("Usage: %s [OPTION]... NAME TYPE [MAJOR MINOR]\n", program_name); + printf ("\ +Create the special file NAME of the given TYPE.\n\ +\n\ + -m, --mode=MODE set permission mode (as in chmod), not 0666 - umask\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ +\n\ +MAJOR MINOR are forbidden for TYPE p, mandatory otherwise. TYPE may be:\n\ +\n\ + b create a block (buffered) special file\n\ + c, u create a character (unbuffered) special file \n\ + p create a FIFO\n"); + } + exit (status); +} + void main (int argc, char **argv) { @@ -201,28 +224,3 @@ major and minor device numbers may not be specified for fifo files"); exit (0); } - -static void -usage (int status) -{ - if (status != 0) - fprintf (stderr, "Try `%s --help' for more information.\n", - program_name); - else - { - printf ("Usage: %s [OPTION]... NAME TYPE [MAJOR MINOR]\n", program_name); - printf ("\ -Create the special file NAME of the given TYPE.\n\ -\n\ - -m, --mode=MODE set permission mode (as in chmod), not 0666 - umask\n\ - --help display this help and exit\n\ - --version output version information and exit\n\ -\n\ -MAJOR MINOR are forbidden for TYPE p, mandatory otherwise. TYPE may be:\n\ -\n\ - b create a block (buffered) special file\n\ - c, u create a character (unbuffered) special file \n\ - p create a FIFO\n"); - } - exit (status); -} -- cgit v1.2.3-54-g00ecf