diff options
-rw-r--r-- | lib/save-cwd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/save-cwd.c b/lib/save-cwd.c index 6fb39f0aa..f97e9c4f0 100644 --- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -1,5 +1,5 @@ /* save-cwd.c -- Save and restore current working directory. - Copyright (C) 1995, 1997, 1998, 2003 Free Software Foundation, Inc. + Copyright (C) 1995, 1997, 1998, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -76,7 +76,10 @@ save_cwd (struct saved_cwd *cwd) #if HAVE_FCHDIR cwd->desc = open (".", O_RDONLY | O_DIRECTORY); if (cwd->desc < 0) - return 1; + { + cwd->name = xgetcwd (); + return cwd->name == NULL; + } # if __sun__ || sun /* On SunOS 4 and IRIX 5.3, fchdir returns EINVAL when auditing |