bug-findutils
[Top][All Lists]
Advanced

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

Re: [PATCH] Fix find -printf %Y on systems with fstatat().


From: Nick Alcock
Subject: Re: [PATCH] Fix find -printf %Y on systems with fstatat().
Date: Wed, 06 Jun 2012 17:55:24 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux)

On 6 Jun 2012, Nick Alcock told this:

> On 6 Jun 2012, Nick Alcock uttered the following:
>
>> We were dropping back to the fallback stat (which turns into an
>> fstatat() with O_NOFOLLOW) even when the return from fstatat()
>> indicated -ENOENT or -ELOOP, which should be preserved unchanged
>> so that the caller can print 'L' or 'N' accordingly.
>
> Hm. I must have typoed in my make check run, because this is now
> triggering testsuite failures: find -H is broken. Finding a better fix
> now...

I think the tests may be faulty. The question is, what should

find -H . -printf %Y

print, when the only symlink in . is broken? What if you change that -H
to a -P, or a -L?

If you go by the documentation (manpage or texi), these should all print
'N'. However, the *code* does something quite different, dereferencing
symlinks if they are not being dereferenced by default, and vice versa
if they are being followed: so it prints 'l' when -L is in effect, and
'N' otherwise. This behaviour is clearly intentional and is more
expressive than the alternative, perhaps, but is more than slightly
counterintuitive, and is not documented.

(In both these cases, testsuite/find.gnu/xtype.exp appears to be broken,
since it is verifying that under -H, broken links print 'l', which is
not true under the documentation or under the apparent intent of the
code.)

So... do I change the testsuite and resubmit, or change the
documentation and resubmit, or something entirely else?

-- 
NULL && (void)



reply via email to

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