From ca1b088722ef895ead8eeb465e9189aef3917dc4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 4 Mar 2003 21:29:13 +0000 Subject: (CLEANUP_CWD): Call error here, now that restore_cwd no longer does it. --- lib/makepath.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/makepath.c b/lib/makepath.c index a725e8597..70038be78 100644 --- a/lib/makepath.c +++ b/lib/makepath.c @@ -117,10 +117,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) -- cgit v1.2.3-70-g09d2