diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-10-18 22:28:26 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-10-18 22:28:26 +0000 |
commit | b0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7 (patch) | |
tree | b951f34000ebdef0491eecd9386e5ea3e535171a /mknod.c | |
parent | 703c62da63aa31d665a8215f373b26e4b54f1bf4 (diff) |
More stuff.
-Erik
Diffstat (limited to 'mknod.c')
-rw-r--r-- | mknod.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -1,4 +1,5 @@ #include "internal.h" +#include <stdio.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> @@ -13,7 +14,7 @@ const char mknod_usage[] = "mknod file b|c|u|p major minor\n" "\tp:\tMake a named pipe. Major and minor are ignored for named pipes.\n"; int -mknod_main(struct FileInfo * i, int argc, char * * argv) +mknod_main(int argc, char** argv) { mode_t mode = 0; dev_t dev = 0; @@ -30,23 +31,21 @@ mknod_main(struct FileInfo * i, int argc, char * * argv) mode = S_IFIFO; break; default: - usage(mknod_usage); - return 1; + usage (mknod_usage); } if ( mode == S_IFCHR || mode == S_IFBLK ) { dev = (atoi(argv[3]) << 8) | atoi(argv[4]); if ( argc != 5 ) { - usage(mknod_usage); - return 1; + usage (mknod_usage); } } mode |= 0666; if ( mknod(argv[1], mode, dev) != 0 ) { - name_and_error(argv[1]); - return 1; + perror(argv[1]); + return( FALSE); } - return 0; + return( TRUE); } |