bug-gnulib
[Top][All Lists]
Advanced

[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: Tue, 26 Apr 2011 19:33:00 -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/26/2011 07:03 PM, Bruno Haible wrote:
> Eric Blake wrote:
>> diff --git a/modules/save-cwd b/modules/save-cwd
>> index 02a0723..974b596 100644
>> --- a/modules/save-cwd
>> +++ b/modules/save-cwd
>> @@ -9,7 +9,7 @@ m4/save-cwd.m4
>>  Depends-on:
>>  chdir-long
>>  cloexec
>> -getcwd
>> +getcwd-lgpl
>>  fchdir
>>  stdbool
>>  unistd-safer
> 
> Here it would be useful to add a comment to lib/save-cwd.c that explains:
> This code can be use with either the module 'getcwd' or 'getcwd-lgpl'. Using
> module 'getcwd' makes it less likely that save_cwd fails, so it is preferred.

But according to my commit message, it makes no difference.  The code
prefers fchdir, which exists on all platforms except mingw.  It falls
back to getcwd(NULL,0) if fchdir is missing, but on mingw, getcwd()
works just fine (even without the getcwd-lgpl module); at any rate, the
point is that the getcwd module doesn't add any safety to save-cwd over
and above what getcwd-lgpl already did.

OK, I'll also copy my commit message comment into the .c file.

-- 
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]