Improve diagnostics for restore_cwd failure.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 14 Jun 2005 23:58:00 +0000 (23:58 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 14 Jun 2005 23:58:00 +0000 (23:58 +0000)
ChangeLog
lib/ChangeLog

index a461311..0d9a067 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,17 @@
 
        * Version 5.3.1.
 
+       Improve diagnostics for restore_cwd failure.
+       * src/install.c (main): Standardize on a diagnostic for
+       restore_cwd failure, and report errno.
+       (install_file_in_file_parents): Fail if restore_cwd fails and
+       one of the files is relative.  This fixes a bug (albeit unlikely).
+       * src/mkdir.c (create_parents): Remove static var (now local to 'main').
+       (main): Standardize on a diagnostic for restore_cwd failure,
+       and report errno.
+       Don't bother to check cwd_errno unless create_parents.
+       Use mkdir rather than make_dir; it's simpler.
+
        * src/install.c (main): Adjust to new make_dir_parents convention.
        * src/mkdir.c (main): Likewise.
 
index fabf690..2e0854e 100644 (file)
@@ -1,5 +1,13 @@
 2005-06-14  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Improve quality of diagnostics on restore_cwd failure.
+       * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
+       (make_dir_parents): Last arg is now int * (for errno), not bool *.
+       * mkdir-p.c (make_dir, make_dir_parents): Likewise.
+       Rewrite "mkdir -p" algorithm to avoid the need for "stat"
+       each time through the loop.  Do not diagnose restore_cwd failure;
+       that is the caller's job (and perhaps the caller does not care).
+
        * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
        (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
        If the file already exists but is not a directory, don't bother