summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-12-27 07:57:14 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-12-27 07:57:14 +0000
commit97fe820f88496c222533718348fbf5e4456d20e7 (patch)
tree0cb5578656107ee442f10d8ba44f0b65c2cc005c
parentee7334652f4bcf14a9c61d0dd1c6e456ce459c51 (diff)
downloadcoreutils-97fe820f88496c222533718348fbf5e4456d20e7.tar.xz
(save_cwd): Don't bother trying to open directory
for write access: POSIX says that must fail.
-rw-r--r--lib/save-cwd.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/save-cwd.c b/lib/save-cwd.c
index 4ff600e58..f842ccafc 100644
--- a/lib/save-cwd.c
+++ b/lib/save-cwd.c
@@ -75,12 +75,8 @@ save_cwd (struct saved_cwd *cwd)
cwd->desc = open (".", O_RDONLY);
if (cwd->desc < 0)
{
- cwd->desc = open (".", O_WRONLY);
- if (cwd->desc < 0)
- {
- cwd->name = xgetcwd ();
- return cwd->name ? 0 : -1;
- }
+ cwd->name = xgetcwd ();
+ return cwd->name ? 0 : -1;
}
return 0;