X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fmkfifo.c;h=728e1ec2f44d7a01d1278a2698ff46ca49cb7fb7;hb=f5d5e77321ad32b3952dcdf21d14fd0ef3d4c1a9;hp=b273df04633abc38665bffb0412d4999b8546bcd;hpb=5e1189e187f6a7957dadb8eda2c271c4a0777a23;p=oweals%2Fbusybox.git diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index b273df046..728e1ec2f 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c @@ -20,18 +20,11 @@ * */ -#include "internal.h" +#include "busybox.h" #include #include -#include #include -static const char mkfifo_usage[] = "mkfifo [OPTIONS] name\n\n" - "Creates a named pipe (identical to 'mknod name p')\n\n" - - "Options:\n" - "\t-m\tcreate the pipe using the specified mode (default a=rw)\n"; - extern int mkfifo_main(int argc, char **argv) { char *thisarg; @@ -58,12 +51,9 @@ extern int mkfifo_main(int argc, char **argv) argc--; argv++; } - if (argc < 1) + if (argc < 1 || *argv[0] == '-') usage(mkfifo_usage); - if (mkfifo(*argv, mode) < 0) { - perror("mkfifo"); - exit(255); - } else { - exit(TRUE); - } + if (mkfifo(*argv, mode) < 0) + perror_msg_and_die("mkfifo"); + return EXIT_SUCCESS; }