bug-coreutils
[Top][All Lists]
Advanced

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

Re: 'make check' fails


From: Pádraig Brady
Subject: Re: 'make check' fails
Date: Sat, 05 Dec 2009 23:57:26 +0000
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Jim Meyering wrote:
> Pádraig Brady wrote:
>> Perhaps we should change ls to also print the 0 if the stat succeeds?
> 
> Do you think that'd be worthwhile?
> I wouldn't want to update the documentation to explain under
> which conditions you might see a "0" rather than "?" ;-)

Well it would allow one to distinguish between a failure
and the system returning 0 for st_ino. Also it would be
more consistent with stat(1). But you're right that the
gain is marginal, especially if st_ino==0 is deemed invalid,
which POSIX seems to suggest.

>> That means we can distinguish between a failure (?) and the OS
>> returning 0 as a "valid" number.
>> Also, even if we do that, in the test we would need to skip the case
>> where `stat` returns nothing on error.
> 
> As suggested, this should do the trick:
> 
>    stat_inode=$(env stat --format=%i $dir)
> +  # If stat fails or says the inode is 0, skip $dir.
> +  case $stat_inode in 0|'') continue;; esac
>    test "$readdir_inode" = "$stat_inode" || fail=1

Looks good.

cheers,
Pádraig.




reply via email to

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