summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;