X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsave-cwd.c;h=b77edb339203c50c3cf1b7d24eed68b66682a7ba;hb=8b687a1afe82bd2e5900a51c4340039884d4ba3c;hp=4bc02e49a2c0ce34601c09caa21f5fa7aa9175b8;hpb=d349992d82f97d614404565ff66e3f8a47b4a568;p=gnulib.git diff --git a/lib/save-cwd.c b/lib/save-cwd.c index 4bc02e49a..b77edb339 100644 --- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -1,5 +1,5 @@ /* save-cwd.c -- Save and restore current working directory. - Copyright (C) 1995, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1997, 1998 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 @@ -42,6 +42,10 @@ extern int errno; #endif +#ifndef O_DIRECTORY +# define O_DIRECTORY 0 +#endif + #include "save-cwd.h" #include "error.h" @@ -67,7 +71,7 @@ save_cwd (struct saved_cwd *cwd) if (have_working_fchdir) { #if HAVE_FCHDIR - cwd->desc = open (".", O_RDONLY); + cwd->desc = open (".", O_RDONLY | O_DIRECTORY); if (cwd->desc < 0) { error (0, errno, "cannot open current directory");