PArtial Changelog update. I'm still on vacation (I'm at a campground
[oweals/busybox.git] / mkfifo.c
index 46b1343cd33c2f46c58825e9b3caad75b9a4bce8..ca217fa236d2d4919a9559ade6491950c7155543 100644 (file)
--- a/mkfifo.c
+++ b/mkfifo.c
  *
  */
 
-#include "internal.h"
 #include <stdio.h>
 #include <sys/types.h>
-#include <sys/stat.h>
 #include <errno.h>
-
-static const char mkfifo_usage[] = "mkfifo [OPTIONS] name\n"
-#ifndef BB_FEATURE_TRIVIAL_HELP
-       "\nCreates 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"
-#endif
-       ;
+#include <stdlib.h>
+#include "busybox.h"
 
 extern int mkfifo_main(int argc, char **argv)
 {
@@ -45,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) {
@@ -55,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 || *argv[0] == '-')
-               usage(mkfifo_usage);
-       if (mkfifo(*argv, mode) < 0) {
-               perror("mkfifo");
-               exit(255);
-       } else {
-               exit(TRUE);
-       }
+               show_usage();
+       if (mkfifo(*argv, mode) < 0)
+               perror_msg_and_die("mkfifo");
+       return EXIT_SUCCESS;
 }