]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(make_path): Restore umask *before* creating the final component.
authorJim Meyering <jim@meyering.net>
Sat, 28 Sep 2002 07:55:08 +0000 (07:55 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 28 Sep 2002 07:55:08 +0000 (07:55 +0000)
lib/makepath.c

index 007301077e8113222177a2b9dcf61229b14b6cd8..4f954ba3a0b414697acda3fdda1d8e42926d242f 100644 (file)
@@ -355,6 +355,9 @@ make_path (const char *argpath,
       if (!do_chdir)
        basename_dir = dirpath;
 
+      /* Done creating leading directories.  Restore original umask.  */
+      umask (oldmask);
+
       /* We're done making leading directories.
         Create the final component of the path.  */
 
@@ -364,9 +367,6 @@ make_path (const char *argpath,
          return 1;
        }
 
-      /* Done creating directories.  Restore original umask.  */
-      umask (oldmask);
-
       if (verbose_fmt_string != NULL)
        error (0, 0, verbose_fmt_string, quote (dirpath));