projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f565b91
)
Add my comment from ChangeLog entry for gkm's change.
author
Jim Meyering
<jim@meyering.net>
Wed, 11 Feb 1998 22:17:38 +0000
(22:17 +0000)
committer
Jim Meyering
<jim@meyering.net>
Wed, 11 Feb 1998 22:17:38 +0000
(22:17 +0000)
lib/makepath.c
patch
|
blob
|
history
diff --git
a/lib/makepath.c
b/lib/makepath.c
index ea0a021d863393f891379b746f4fdfb11de5ab39..99119a213107aa821a92a3095f80def13994ddf3 100644
(file)
--- a/
lib/makepath.c
+++ b/
lib/makepath.c
@@
-217,6
+217,14
@@
make_path (const char *argpath,
if (!do_chdir)
basename_dir = dirpath;
if (!do_chdir)
basename_dir = dirpath;
+ /* The mkdir and stat calls below appear to be reversed.
+ They are not. It is important to call mkdir first and then to
+ call stat (to distinguish the three cases) only if mkdir fails.
+ The alternative to this approach is to `stat' each directory,
+ then to call mkdir if it doesn't exist. But if some other process
+ were to create the directory between the stat & mkdir, the mkdir
+ would fail with EEXIST. */
+
*slash = '\0';
if (mkdir (basename_dir, tmp_mode))
{
*slash = '\0';
if (mkdir (basename_dir, tmp_mode))
{