]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
remove/openat cleanup
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 17 Dec 2005 06:56:19 +0000 (06:56 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 17 Dec 2005 06:56:19 +0000 (06:56 +0000)
ChangeLog
lib/ChangeLog

index 29b9395a52a0078d4c3f54652a9d246430cbd633..60e1597fc26f5824de3d9e7927c640cae268e5f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,20 @@
-2005-12-15  Jim Meyering  <jim@meyering.net>
+2005-12-16  Paul Eggert  <eggert@cs.ucla.edu>
 
        * Version 6.0-cvs.
 
+       * src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
+       (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
+       (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
+       value is now signified by whether cwd_errno is null.
+       (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
+       pointer-to-bool to pointer-to-errno-value.  All callers changed.
+       (rm_1): Don't bother setting a local cwd failure flag and then
+       ORing it into the caller's.  Just set the caller's.
+       (rm): Use cwd failure errno value to print a slightly-better
+       diagnostic.
+
+2005-12-15  Jim Meyering  <jim@meyering.net>
+
        * src/stat.c (print_it): Properly handle a backslash at the
        end of a --printf format string.  Reported by Paul Eggert.
        * tests/misc/stat-printf (end-bs): Add a test for the above.
index 4fcf6487b2447097a0963100afb32609387f1e1f..c4f4e257199c4d5d76405b3088f5aa5b28a42c31 100644 (file)
@@ -1,3 +1,30 @@
+2005-12-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
+       "gettext.h"; either no longer needed or are guaranteed by openat.h.
+       (_): Remove; no longer needed.
+       (openat): Renamed from rpl_openat; no need for rpl_openat
+       since openat.h renames openat for us.
+       Replace most of the body with a call to openat_permissive,
+       to avoid duplicate code.
+       Port to (probably hypothetical) environments were mode_t is
+       wider than int.
+       (openat_permissive): Require mode arg, so that we can check
+       types better.  Put it just after flags.  Change cwd failure
+       indicator from pointer-to-bool to pointer-to-errno-value.
+       All callers changed.
+       Invoke openat_save_fail and/or openat_restore_fail if
+       cwd_errno is null, so that openat can call us.
+       (openat_permissive, fdopendir, fstatat, unlinkat):
+       Simplify errno handling to avoid some duplicate code,
+       as it's OK to set errno on success.
+       * openat.h: Revamp code so that function macros depend on
+       __OPENAT_PREFIX only, not also on AT_FDCWD.
+       (openat_ro): Remove.  Caller changed to use openat_permissive.
+       (openat_permissive): Now a macro, if not a function.
+       (openat_restore_fail, openat_save_fail): Now always functions,
+       since mkdirat needs them even if __OPENAT_PREFIX is defined.
+
 2005-12-14  Jim Meyering  <jim@meyering.net>
 
        * Makefile.am (libcoreutils_a_SOURCES): Remove fprintftime.c