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: Pádraig Brady
Subject: Re: `du` check for directory loop avoidance
Date: Thu, 19 Jun 2014 12:23:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

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.

thanks,
Pádraig.

Attachment: du-bind-loop.patch
Description: Text Data


reply via email to

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