* modules/openat (Files): Add lib/openat-die.c.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 22 Sep 2005 23:30:37 +0000 (23:30 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 22 Sep 2005 23:30:37 +0000 (23:30 +0000)
commit357e1c26576e584fbc24b72798d2f7cf70bd9867
tree7e0fb45074a649b346955c5f6abe6db3b2914982
parenta095eb9d7165c3e5eb67762b6de68adb2384c842
* modules/openat (Files): Add lib/openat-die.c.
(Depends-on): Remove error, exitfail.
Add dirname.
* lib/openat.c (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.
* lib/openat.c (unlinkat): New function.
* lib/openat.h (unlinkat): Add prototype.
* lib/openat-die.c (openat_save_fail): Rename from openat_save_die.
(openat_restore_fail): Rename from openat_restore_die.
* lib/openat.c, openat.h: Reflect s/_die/_fail/ renaming.

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.
* lib/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.

* lib/openat-die.c (openat_save_die, openat_restore_die): New file.
* lib/openat.h (openat_save_die, openat_restore_die): Declare and define.
* m4/openat.m4 (gl_FUNC_OPENAT): Add openat-die.c.
lib/openat-die.c [new file with mode: 0644]
lib/openat.c
lib/openat.h
m4/openat.m4
modules/openat