Mercurial > hg > octave-lyh > gnulib-hg
changeset 2903:4800be10df17
(O_DIRECTORY): Define, if needed.
(save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
Suggestion from Ulrich Drepper.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sun, 22 Oct 2000 06:57:42 +0000 |
parents | f5d9bb987058 |
children | 8d7b6f000b0d |
files | lib/save-cwd.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -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 @@ 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");