diff options
Diffstat (limited to 'mkdir.c')
-rw-r--r-- | mkdir.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -84,7 +84,7 @@ extern int mkdir_main(int argc, char **argv) | |||
84 | 84 | ||
85 | strcpy (buf, *argv); | 85 | strcpy (buf, *argv); |
86 | status=stat(buf, &statBuf); | 86 | status=stat(buf, &statBuf); |
87 | if (status != -1 && status != ENOENT ) { | 87 | if (parentFlag == FALSE && status != -1 && status != ENOENT ) { |
88 | fprintf(stderr, "%s: File exists\n", buf); | 88 | fprintf(stderr, "%s: File exists\n", buf); |
89 | exit( FALSE); | 89 | exit( FALSE); |
90 | } | 90 | } |
@@ -93,7 +93,7 @@ extern int mkdir_main(int argc, char **argv) | |||
93 | createPath(buf, mode); | 93 | createPath(buf, mode); |
94 | } | 94 | } |
95 | else { | 95 | else { |
96 | if (mkdir (buf, mode) != 0) { | 96 | if (mkdir (buf, mode) != 0 && parentFlag == FALSE) { |
97 | perror(buf); | 97 | perror(buf); |
98 | exit( FALSE); | 98 | exit( FALSE); |
99 | } | 99 | } |