coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `du` check for directory loop avoidance


From: Jim Meyering
Subject: Re: `du` check for directory loop avoidance
Date: Thu, 19 Jun 2014 09:49:32 -0700

On Thu, Jun 19, 2014 at 4:23 AM, Pádraig Brady <address@hidden> wrote:
> On 12/18/2013 05:39 PM, Eric Blake wrote:
>> On 12/18/2013 09:46 AM, Jeff Kirkpatrick wrote:
>>> However, I don't see explicit reasons for the non-zero exit code. If you
>>> want to ask for the reason, you may write an emailto address@hidden."
>>>
>>> Can anyone elaborate on why the decision to use a non-zero exit code?
>>
>> Because POSIX requires a non-zero exit code any time an error message is
>> output, including when a directory is skipped due to a directory loop.
>>
>> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/du.html
>
> We suppress the cycle warning when following symlinks
> as it's not an error in that case.
> Similarly we should suppress the cycle warning for bind mounts
> as it's not an error in that case either.
> Hence I propose the attached to avoid the exit failure in this case.
>
> I'm not considering other tools that emit_cycle_warning() yet,
> as they're less likely to be used in such cases.

That looks perfect.  Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]