On 04/27/2011 01:37 AM, Jim Meyering wrote:
> Eric Blake wrote:
>> save-cwd needs either a working fchdir or a working getcwd(NULL).
>> The only platform where getcwd fixes problems not solved by
>> getcwd-lgpl is Linux, but fchdir works there.
>>
> Hi Eric,
> 
> Unfortunately, that change would introduce a bug.  save_cwd's
> open (".", O_SEARCH) may fail in a directory where getcwd's
> function would succeed, while getcwd-lgpl's would not.
> Thus, we have to use the robust getcwd module there.

Hmm, you're right.  I'll go with Bruno's suggestion, then, of
documenting that save-cwd "works" with getcwd-lgpl, but is more robust
with getcwd.  Coreutils, of course, uses getcwd, so there is no
regression in behavior there, even if the save-cwd module relaxes its
default dependency.

> This condition will persist as long as we have to worry about
> O_SEARCH being defined to O_RDONLY.

I wonder if anyone on the kernel is working on this.

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to