Fix error messages conditions, and make them the same as GNU mkdir.
authorGlenn L McGrath <bug1@ihug.co.nz>
Sun, 22 Sep 2002 02:12:30 +0000 (02:12 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Sun, 22 Sep 2002 02:12:30 +0000 (02:12 -0000)
libbb/make_directory.c

index 1c3026ccc65f982f0f1c36763e393cd9432d9413..2a2788b68fad50f65124163db2639ffd6884a8ca 100644 (file)
@@ -58,10 +58,10 @@ int make_directory (char *path, long mode, int flags)
        }
        ret = mkdir(path, mode);
        if (ret == -1) {
-               if (errno == EEXIST) {
+               if ((flags == FILEUTILS_RECUR) && (errno == EEXIST)) {
                        ret = 0;
                } else {
-                       perror_msg("Cannot create directory %s", path);
+                       perror_msg("Cannot create directory '%s'", path);
                }
        }
        return(ret);