On 15/12/2018 1:27 AM, Paul Eggert wrote:
+ if (stat (dir + prefix_len, &st) == 0
+ && S_ISDIR (st.st_mode))
That patch doesn't look quite right, since it can use errno even when stat
succeeded (in which case errno contains garbage).
Oops, you're right,
Until now, a stat() `errno` created by `mkdir -p` after `mkdir()` is dropped
silently, leading to very confusing error messages that hide the actual source
of the error:
`mkdir -p` can say
cannot create directory ‘dir: File exists`
when indeed the the file exists, is a directory (shows `d` i