Log of /coreutils/lib/openat.c
Parent Directory
| Revision Log
Revision
1.30
Mon Aug 21 07:26:47 2006 UTC
(17 years, 8 months ago)
by
eggert
Branch:
MAIN
CVS Tags:
HEAD
Changes since
1.29: +0 -0 lines
FILE REMOVED
Remove from CVS, since the bootstrap script generates them automatically.
Revision
1.29 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Tue Aug 15 19:17:30 2006 UTC
(17 years, 8 months ago)
by
meyering
Branch:
MAIN
CVS Tags:
COREUTILS-6_1
Changes since
1.28: +37 -139 lines
Diff to
previous 1.28
[./]
* .x-sc_require_config_h: Add lib/at-func.c.
[lib/]
* at-func.c: New file, with the logic of all emulated at-functions.
* openat-priv.h: Include <errno.h> and define ENOSYS,
in support of the EXPECTED_ERRNO macro.
* openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
Instead, define the appropriate symbols and include "at-func.c".
* mkdirat.c (mkdirat): Likewise.
* fchmodat.c (fchmodat): Likewise.
(ENOSYS): Remove definition.
* openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
Don't include "unistd--.h" -- it wasn't ever used.
[m4/]
* openat.m4 (gl_FUNC_OPENAT): Add at-func.c via AC_LIBSOURCES.
Revision
1.26 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Thu Feb 16 23:10:01 2006 UTC
(18 years, 2 months ago)
by
meyering
Branch:
MAIN
Changes since
1.25: +1 -0 lines
Diff to
previous 1.25
Include lstat.h, so that uses of lstat are converted
to uses of rpl_lstat, e.g., on Solaris 9. Otherwise, programs like
du (which now uses the openat-enabled fts and hence fstatat) would
mistakenly fail to dereference a symlink-to-directory specified
with a trailing slash.
Revision
1.23 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Thu Dec 22 14:34:20 2005 UTC
(18 years, 4 months ago)
by
meyering
Branch:
MAIN
Changes since
1.22: +3 -1 lines
Diff to
previous 1.22
Include "fcntl--.h" and "unistd--.h", to map open
and dup to open_safer and dup_safer, respectively.
(openat_permissive): Fix typo in comment.
Revision
1.22 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Sat Dec 17 06:55:32 2005 UTC
(18 years, 4 months ago)
by
eggert
Branch:
MAIN
Changes since
1.21: +82 -147 lines
Diff to
previous 1.21
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.
Revision
1.18 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Tue Nov 22 14:52:48 2005 UTC
(18 years, 5 months ago)
by
meyering
Branch:
MAIN
Changes since
1.17: +114 -24 lines
Diff to
previous 1.17
(EXPECTED_ERRNO): New macro.
(openat_permissive): New function -- used in remove.c rewrite.
(all functions): Set errno just before returning, only if there
was an actual failure.
Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
Revision
1.17 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Sat Nov 12 10:06:29 2005 UTC
(18 years, 5 months ago)
by
meyering
Branch:
MAIN
Changes since
1.16: +75 -3 lines
Diff to
previous 1.16
Emulate openat-family functions using Linux's procfs, if possible.
Idea and some code from Ulrich Drepper's glibc changes.
(BUILD_PROC_NAME): New macro.
Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
(rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
before falling back on save_cwd and restore_cwd.
(fdopendir, fstatat, unlinkat): Likewise.
Revision
1.16 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Thu Nov 10 23:20:05 2005 UTC
(18 years, 5 months ago)
by
meyering
Branch:
MAIN
Changes since
1.15: +2 -2 lines
Diff to
previous 1.15
(fstatat, unlinkat): Perform the syscall directly,
skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
Revision
1.15 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Sat Oct 8 09:05:08 2005 UTC
(18 years, 6 months ago)
by
meyering
Branch:
MAIN
CVS Tags:
COREUTILS-5_91,
COREUTILS-5_92,
COREUTILS-5_93,
COREUTILS-5_94,
COREUTILS-5_94-cvs,
COREUTILS-5_95,
COREUTILS-5_96,
COREUTILS-5_97
Branch point for:
b5_9x
Changes since
1.14: +2 -5 lines
Diff to
previous 1.14
(rpl_openat): Use the promoted type (int), not mode_t,
as second argument to va_arg. Otherwise, some versions of gcc
warn that `if this code is reached, the program will abort'.
Revision
1.14 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Fri Sep 30 15:19:24 2005 UTC
(18 years, 6 months ago)
by
meyering
Branch:
MAIN
Changes since
1.13: +7 -6 lines
Diff to
previous 1.13
(fdopendir): Do not define if HAVE_FDOPENDIR.
Remove AT_FDCWD test.
Do not consume the fd unless successful.
Revision
1.12 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Tue Sep 20 13:51:01 2005 UTC
(18 years, 7 months ago)
by
meyering
Branch:
MAIN
Changes since
1.11: +8 -1 lines
Diff to
previous 1.11
(fdopendir): Be sure to close the supplied
file descriptor before returning. This makes our replacement
implementation a little closer to Solaris's, where fdopendir
ties the file descriptor to the returned DIR* pointer.
Revision
1.9 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Tue Jun 14 06:54:39 2005 UTC
(18 years, 10 months ago)
by
meyering
Branch:
MAIN
Changes since
1.8: +8 -15 lines
Diff to
previous 1.8
Provide an alternative to exiting immediately upon save_cwd or
restore_cwd failure. Now, an application can arrange e.g.,
to perform a longjump in that case.
* openat.c: Include dirname.h.
Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
(rpl_openat, fdopendir, fstatat): Call openat_save_die
and openat_restore_die rather than calling error directly.
Don't include "error.h" or "exitfail.h"; they're no longer needed.
* openat-die.c (openat_save_die, openat_restore_die): New file.
* openat.h (openat_save_die, openat_restore_die): Declare and define.
Revision
1.8 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Thu Jun 2 05:05:29 2005 UTC
(18 years, 10 months ago)
by
eggert
Branch:
MAIN
Changes since
1.7: +9 -9 lines
Diff to
previous 1.7
Don't use "path" or "filename" to mean "file name"
in comments or local variable names.
Revision
1.4 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Fri Dec 3 06:43:59 2004 UTC
(19 years, 4 months ago)
by
eggert
Branch:
MAIN
Changes since
1.3: +15 -17 lines
Diff to
previous 1.3
Include "openat.h" before other include files.
Include "exitfail.h".
(openat): Remove #undef; no longer needed now that we include openat.h first.
(rpl_openat): Add comment about mode_t promotion. Simplify
code a bit by moving initializations around. Use exit_failure
rather than EXIT_FAILURE.
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
select a symbolic revision name using the selection box, or choose
'Use Text Field' and enter a numeric revision.