X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fsavewd.c;h=f19e98e3546be812ffb858b67fb504ff06d684c9;hb=4752c7c4aaba4eca621082dc8042646f6efd71ec;hp=e111207ba9dde1ccf7a7eb158a6fc2eb34043361;hpb=8d8eda4eab3d2801251daf4eb31756c3595e2fc6;p=gnulib.git diff --git a/lib/savewd.c b/lib/savewd.c index e111207ba..f19e98e35 100644 --- a/lib/savewd.c +++ b/lib/savewd.c @@ -1,6 +1,6 @@ /* Save and restore the working directory, possibly using a child process. - Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ #include #include -#include "dirname.h" +#include "dosname.h" #include "fcntl-safer.h" /* Save the working directory into *WD, if it hasn't been saved @@ -45,7 +45,7 @@ savewd_save (struct savewd *wd) case INITIAL_STATE: /* Save the working directory, or prepare to fall back if possible. */ { - int fd = open_safer (".", O_RDONLY); + int fd = open_safer (".", O_SEARCH); if (0 <= fd) { wd->state = FD_STATE; @@ -105,7 +105,7 @@ savewd_chdir (struct savewd *wd, char const *dir, int options, || (options & (HAVE_WORKING_O_NOFOLLOW ? SAVEWD_CHDIR_NOFOLLOW : 0))) { fd = open (dir, - (O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK + (O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK | (options & SAVEWD_CHDIR_NOFOLLOW ? O_NOFOLLOW : 0))); if (open_result)