Making note of my changes
[oweals/busybox.git] / mkdir.c
diff --git a/mkdir.c b/mkdir.c
index 9ea3b4ea0905d96e8e8c3721e6ee8f26631c68b8..dc245a18e82715d12d2507ef6cfbf22885ba31e0 100644 (file)
--- a/mkdir.c
+++ b/mkdir.c
@@ -84,7 +84,7 @@ extern int mkdir_main(int argc, char **argv)
 
        strcpy (buf, *argv);
        status=stat(buf, &statBuf);
-       if (status != -1 && status != ENOENT ) {
+       if (parentFlag == FALSE && status != -1 && status != ENOENT ) {
            fprintf(stderr, "%s: File exists\n", buf);
            exit( FALSE);
        }
@@ -93,7 +93,7 @@ extern int mkdir_main(int argc, char **argv)
            createPath(buf, mode);
        }
        else { 
-           if (mkdir (buf, mode) != 0) {
+           if (mkdir (buf, mode) != 0 && parentFlag == FALSE) {
                perror(buf);
                exit( FALSE);
            }