[Top][All Lists]

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

Re: [PATCHv2 4/9] save-cwd: reduce dependency

From: Eric Blake
Subject: Re: [PATCHv2 4/9] save-cwd: reduce dependency
Date: Wed, 27 Apr 2011 06:57:27 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9

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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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