projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3c5bb86
)
(CLEANUP_CWD): Report an error if we failed to return to the initial
author
Paul Eggert
<eggert@cs.ucla.edu>
Thu, 14 Aug 2003 23:07:29 +0000
(23:07 +0000)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Thu, 14 Aug 2003 23:07:29 +0000
(23:07 +0000)
working directory. Preserve errno for caller.
lib/makepath.c
patch
|
blob
|
history
diff --git
a/lib/makepath.c
b/lib/makepath.c
index 0f20bcde9e12b70d805d9d131d4618c2b9a2d01a..f2dfe8891411e582f61f8a7cee175f538b5aee71 100644
(file)
--- a/
lib/makepath.c
+++ b/
lib/makepath.c
@@
-105,10
+105,16
@@
extern int errno;
Restore working directory. */ \
if (do_chdir) \
{ \
- int _fail = restore_cwd (&cwd, NULL, NULL); \
+ if (restore_cwd (&cwd) != 0) \
+ { \
+ int _saved_errno = errno; \
+ error (0, errno, \
+ _("failed to return to initial working directory")); \
+ free_cwd (&cwd); \
+ errno = _saved_errno; \
+ return 1; \
+ } \
free_cwd (&cwd); \
- if (_fail) \
- return 1; \
} \
} \
while (0)