summaryrefslogtreecommitdiff
path: root/lib/makepath.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-09-28 07:55:08 +0000
committerJim Meyering <jim@meyering.net>2002-09-28 07:55:08 +0000
commitddb038c033eb6a9b1ba4820d6cc053411bedde40 (patch)
tree0d654a85853f6604f8f4780b4327bec01c1e8ef5 /lib/makepath.c
parent8c10d25fd0e66bbdd25160a97a06aac8363dce2f (diff)
downloadcoreutils-ddb038c033eb6a9b1ba4820d6cc053411bedde40.tar.xz
(make_path): Restore umask *before* creating the final component.
Diffstat (limited to 'lib/makepath.c')
-rw-r--r--lib/makepath.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/makepath.c b/lib/makepath.c
index 007301077..4f954ba3a 100644
--- a/lib/makepath.c
+++ b/lib/makepath.c
@@ -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));