[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:1.9.2.15) 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
signature.asc
Description: OpenPGP digital signature
[PATCHv2 2/9] getcwd-lgpl: new module, Eric Blake, 2011/04/26
[PATCHv2 5/9] dirent-safer: drop unused link dependency, Eric Blake, 2011/04/26
[PATCHv2 6/9] tests: reduce dependencies, Eric Blake, 2011/04/26
[PATCHv2 3/9] getcwd: enhance tests, Eric Blake, 2011/04/26