projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Document merges from coreutils.
[gnulib.git]
/
lib
/
makepath.c
diff --git
a/lib/makepath.c
b/lib/makepath.c
index
513549d
..
f2dfe88
100644
(file)
--- a/
lib/makepath.c
+++ b/
lib/makepath.c
@@
-1,5
+1,7
@@
/* makepath.c -- Ensure that a directory path exists.
/* makepath.c -- Ensure that a directory path exists.
- Copyright (C) 1990, 1997-1999, 2000, 2002-2003 Free Software Foundation, Inc.
+
+ Copyright (C) 1990, 1997, 1998, 1999, 2000, 2002, 2003 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
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
@@
-86,7
+88,6
@@
extern int errno;
#define WX_USR (S_IWUSR | S_IXUSR)
#define WX_USR (S_IWUSR | S_IXUSR)
-/* Include this before libintl.h so we get our definition of PARAMS. */
#include "makepath.h"
#include "gettext.h"
#include "makepath.h"
#include "gettext.h"
@@
-104,10
+105,16
@@
extern int errno;
Restore working directory. */ \
if (do_chdir) \
{ \
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); \
free_cwd (&cwd); \
- if (_fail) \
- return 1; \
} \
} \
while (0)
} \
} \
while (0)
@@
-385,7
+392,7
@@
make_path (const char *argpath,
*(p->dirname_end) = '\0';
if (chmod (dirpath, parent_mode))
{
*(p->dirname_end) = '\0';
if (chmod (dirpath, parent_mode))
{
- error (0, errno,
"cannot change permissions of %s"
,
+ error (0, errno,
_("cannot change permissions of %s")
,
quote (dirpath));
retval = 1;
}
quote (dirpath));
retval = 1;
}