Add errno.h
[oweals/busybox.git] / mkdir.c
diff --git a/mkdir.c b/mkdir.c
index f824cdcb671bb9bc5804d52a9b4a040b63b51b70..92357a665f7cf8a01afb5fdbb80ebc0c1d9057a8 100644 (file)
--- a/mkdir.c
+++ b/mkdir.c
@@ -21,7 +21,7 @@
  *
  */
 
-#include "internal.h"
+#include "busybox.h"
 #define bb_need_name_too_long
 #define BB_DECLARE_EXTERN
 #include "messages.c"
@@ -50,8 +50,8 @@ extern int mkdir_main(int argc, char **argv)
                                /* Find the specified modes */
                                mode = 0;
                                if (parse_mode(*(++argv), &mode) == FALSE) {
-                                       errorMsg("Unknown mode: %s\n", *argv);
-                                       exit FALSE;
+                                       error_msg("Unknown mode: %s\n", *argv);
+                                       return EXIT_FAILURE;
                                }
                                /* Set the umask for this process so it doesn't 
                                 * screw up whatever the user just entered. */
@@ -79,26 +79,26 @@ extern int mkdir_main(int argc, char **argv)
                char buf[BUFSIZ + 1];
 
                if (strlen(*argv) > BUFSIZ - 1) {
-                       errorMsg(name_too_long);
-                       exit FALSE;
+                       error_msg(name_too_long);
+                       return EXIT_FAILURE;
                }
                strcpy(buf, *argv);
                status = stat(buf, &statBuf);
                if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
-                       errorMsg("%s: File exists\n", buf);
-                       exit FALSE;
+                       error_msg("%s: File exists\n", buf);
+                       return EXIT_FAILURE;
                }
                if (parentFlag == TRUE) {
                        strcat(buf, "/");
-                       createPath(buf, mode);
+                       create_path(buf, mode);
                } else {
                        if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
                                perror(buf);
-                               exit FALSE;
+                               return EXIT_FAILURE;
                        }
                }
                argc--;
                argv++;
        }
-       return( TRUE);
+       return EXIT_SUCCESS;
 }