projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b45f6d4
)
(O_DIRECTORY): Define, if needed.
author
Jim Meyering
<jim@meyering.net>
Sun, 22 Oct 2000 06:57:42 +0000
(06:57 +0000)
committer
Jim Meyering
<jim@meyering.net>
Sun, 22 Oct 2000 06:57:42 +0000
(06:57 +0000)
(save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
Suggestion from Ulrich Drepper.
lib/save-cwd.c
patch
|
blob
|
history
diff --git
a/lib/save-cwd.c
b/lib/save-cwd.c
index 564c91829643365c268402756d04cdc8db4715d0..b77edb339203c50c3cf1b7d24eed68b66682a7ba 100644
(file)
--- 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
@@
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");