/[coreutils]/coreutils/lib/openat.c
ViewVC logotype

Log of /coreutils/lib/openat.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Tag:

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.28 - (view) (download) (annotate) - [select for diffs]
Tue Jun 20 19:20:25 2006 UTC (17 years, 10 months ago) by eggert
Branch: MAIN
CVS Tags: COREUTILS-6_0
Changes since 1.27: +3 -4 lines
Diff to previous 1.27
(openat): Use ?:, not if, to work around GCC bug 4210.


Revision 1.27 - (view) (download) (annotate) - [select for diffs]
Tue Jun 20 10:19:40 2006 UTC (17 years, 10 months ago) by meyering
Branch: MAIN
Changes since 1.26: +1 -1 lines
Diff to previous 1.26
fix typo in comment: s/nerrower/narrower/


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.25 - (view) (download) (annotate) - [select for diffs]
Tue Jan 17 17:43:10 2006 UTC (18 years, 3 months ago) by meyering
Branch: MAIN
Changes since 1.24: +28 -4 lines
Diff to previous 1.24
(openat_needs_fchdir): New function.


Revision 1.24 - (view) (download) (annotate) - [select for diffs]
Wed Jan 11 13:32:03 2006 UTC (18 years, 3 months ago) by meyering
Branch: MAIN
Changes since 1.23: +59 -5 lines
Diff to previous 1.23
(fchownat): New function.


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.21 - (view) (download) (annotate) - [select for diffs]
Wed Nov 30 13:04:26 2005 UTC (18 years, 4 months ago) by meyering
Branch: MAIN
Changes since 1.20: +1 -31 lines
Diff to previous 1.20
Include openat-priv.h.
Remove definitions of macros defined therein.


Revision 1.20 - (view) (download) (annotate) - [select for diffs]
Wed Nov 23 13:36:48 2005 UTC (18 years, 5 months ago) by meyering
Branch: MAIN
Changes since 1.19: +5 -5 lines
Diff to previous 1.19
tweak grammar in comments


Revision 1.19 - (view) (download) (annotate) - [select for diffs]
Wed Nov 23 13:35:09 2005 UTC (18 years, 5 months ago) by meyering
Branch: MAIN
Changes since 1.18: +1 -1 lines
Diff to previous 1.18
(fdopendir): Don't change errno when returning non-NULL.


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.13 - (view) (download) (annotate) - [select for diffs]
Thu Sep 22 06:05:39 2005 UTC (18 years, 7 months ago) by eggert
Branch: MAIN
CVS Tags: COREUTILS-5_90
Changes since 1.12: +3 -1 lines
Diff to previous 1.12
Sync from gnulib.


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.11 - (view) (download) (annotate) - [select for diffs]
Mon Sep 19 15:45:05 2005 UTC (18 years, 7 months ago) by meyering
Branch: MAIN
Changes since 1.10: +40 -0 lines
Diff to previous 1.10
(unlinkat): New function.


Revision 1.10 - (view) (download) (annotate) - [select for diffs]
Tue Jun 14 09:46:24 2005 UTC (18 years, 10 months ago) by meyering
Branch: MAIN
Changes since 1.9: +6 -6 lines
Diff to previous 1.9
Reflect s/_die/_fail/ renaming.


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.7 - (view) (download) (annotate) - [select for diffs]
Sat May 14 07:58:06 2005 UTC (18 years, 11 months ago) by meyering
Branch: MAIN
Changes since 1.6: +1 -1 lines
Diff to previous 1.6
Update FSF postal mail address.


Revision 1.6 - (view) (download) (annotate) - [select for diffs]
Wed Jan 19 09:58:01 2005 UTC (19 years, 3 months ago) by meyering
Branch: MAIN
Changes since 1.5: +89 -1 lines
Diff to previous 1.5
(fdopendir, fstatat): New functions.


Revision 1.5 - (view) (download) (annotate) - [select for diffs]
Fri Dec 31 10:06:43 2004 UTC (19 years, 3 months ago) by meyering
Branch: MAIN
CVS Tags: COREUTILS-5_3_0
Changes since 1.4: +7 -1 lines
Diff to previous 1.4
(rpl_openat): Correct comment.
Call free_cwd, to avoid leaking a file descriptor.


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.


Revision 1.3 - (view) (download) (annotate) - [select for diffs]
Sun Nov 28 22:41:57 2004 UTC (19 years, 5 months ago) by meyering
Branch: MAIN
Changes since 1.2: +17 -6 lines
Diff to previous 1.2
(rpl_openat): Also accept optional mode parameter.


Revision 1.2 - (view) (download) (annotate) - [select for diffs]
Sun Nov 28 21:13:59 2004 UTC (19 years, 5 months ago) by meyering
Branch: MAIN
Changes since 1.1: +1 -0 lines
Diff to previous 1.1
*** empty log message ***


Revision 1.1 - (view) (download) (annotate) - [select for diffs]
Sun Nov 28 20:50:26 2004 UTC (19 years, 5 months ago) by meyering
Branch: MAIN
*** empty log message ***


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.

  Diffs between and
  Type of Diff should be a

Sort log by:

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26