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 ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature