[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH shepherd] support: Ignore errors on parent directories in mkd
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH shepherd] support: Ignore errors on parent directories in mkdir-p. |
Date: |
Sat, 06 Feb 2016 14:14:48 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
David Michael <address@hidden> skribis:
> On Thu, Feb 4, 2016 at 11:47 AM, Ludovic Courtès <address@hidden> wrote:
[...]
>> I think that it’s a case where it would be beneficial for the Hurd to
>> follow what Linux does, which is to return EEXIST.
>>
>> How does Coreutils’ ‘mkdir -p’ behave in this situation? (I’ve looked
>> at mkdir-p.c in Gnulib but it’s a bit complicated…)
>
> After a quick glance it basically looks like after any error occurs
> from a mkdir call, it tests if the path exists and is a directory, and
> if so, proceeds ignoring that mkdir error. If mkdir fails and the
> directory doesn't exist afterwards, then the mkdir-p call fails with
> that error.
>
> That sounds like the best option to me: keeping mkdir-p independent of
> the mkdir implementation, while preserving the error from the first
> real problem it encounters. I'll send a patch with that change
> instead.
OK, makes sense, though it incurs an additional ‘stat’ call.
> If you'd still prefer to change the Hurd behavior, we could copy the
> bug-hurd list to discuss, since I'm not sure if such a change will
> have unintended consequences elsewhere.
I think we should do both: submit the Hurd change, which I think is a
good thing in the long run, and work around the problem here.
Ludo’.