diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-12-27 07:57:14 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-12-27 07:57:14 +0000 |
commit | 97fe820f88496c222533718348fbf5e4456d20e7 (patch) | |
tree | 0cb5578656107ee442f10d8ba44f0b65c2cc005c /lib | |
parent | ee7334652f4bcf14a9c61d0dd1c6e456ce459c51 (diff) | |
download | coreutils-97fe820f88496c222533718348fbf5e4456d20e7.tar.xz |
(save_cwd): Don't bother trying to open directory
for write access: POSIX says that must fail.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/save-cwd.c | 8 |
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; |