diff options
Diffstat (limited to 'lib/save-cwd.c')
-rw-r--r-- | lib/save-cwd.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/save-cwd.c b/lib/save-cwd.c index f97e9c4f0..17d077db8 100644 --- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -76,6 +76,8 @@ save_cwd (struct saved_cwd *cwd) #if HAVE_FCHDIR cwd->desc = open (".", O_RDONLY | O_DIRECTORY); if (cwd->desc < 0) + cwd->desc = open (".", O_WRONLY | O_DIRECTORY); + if (cwd->desc < 0) { cwd->name = xgetcwd (); return cwd->name == NULL; |