X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=mkfifo.c;h=ca217fa236d2d4919a9559ade6491950c7155543;hb=5a4a46a2519af1e79d931a856ee1a3b70e60d168;hp=c74402d4c992d14f4e02d0422a1f0c9f3c3729f5;hpb=e49d5ecbbe51718fa925b6890a735e5937cc2aa2;p=oweals%2Fbusybox.git diff --git a/mkfifo.c b/mkfifo.c index c74402d4c..ca217fa23 100644 --- a/mkfifo.c +++ b/mkfifo.c @@ -20,17 +20,11 @@ * */ -#include "internal.h" #include #include -#include #include - -static const char mkfifo_usage[] = "mkfifo [OPTIONS] name\n\n" - "Create the named fifo\n\n" - - "Options:\n" - "\t-m\tcreate the fifo with the specified mode; default = a=rw-umask\n"; +#include +#include "busybox.h" extern int mkfifo_main(int argc, char **argv) { @@ -43,7 +37,7 @@ extern int mkfifo_main(int argc, char **argv) /* Parse any options */ while (argc > 1) { if (**argv != '-') - usage(mkfifo_usage); + show_usage(); thisarg = *argv; thisarg++; switch (*thisarg) { @@ -53,17 +47,14 @@ extern int mkfifo_main(int argc, char **argv) parse_mode(*argv, &mode); break; default: - usage(mkfifo_usage); + show_usage(); } argc--; argv++; } - if (argc < 1) - usage(mkfifo_usage); - if (mkfifo(*argv, mode) < 0) { - perror("mkfifo"); - exit(255); - } else { - exit(TRUE); - } + if (argc < 1 || *argv[0] == '-') + show_usage(); + if (mkfifo(*argv, mode) < 0) + perror_msg_and_die("mkfifo"); + return EXIT_SUCCESS; }