1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-08-27 12:06:59 +00:00

2 Commits

Author SHA1 Message Date
Eric Blake e4ee142063 fcntl: use to simplify other modules
Let fcntl do the work, instead of copying code into other modules.

* modules/cloexec (Depends-on): Add fcntl.
* modules/fchdir (Depends-on): Likewise.
* modules/fd-safer-flag (Depends-on): Likewise.
* modules/unistd-safer (Depends-on): Likewise.
* modules/dup3 (configure.ac): Set module indicator.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Replace fcntl if fchdir is
missing.
* lib/fchdir.c (_gl_register_dup): Fix comment.
* lib/cloexec.c (dup_cloexec): Simplify, by relying on fcntl.
* lib/dup-safer.c (dup_safer): Likewise.
* lib/dup-safer-flag.c (dup_safer_flag): Likewise.
* lib/dup3.c (dup3): Likewise.
* tests/test-fchdir.c (main): Enhance test.
Fixes a dup_cloexec bug reported by Ondřej Vašík.

Signed-off-by: Eric Blake <ebb9@byu.net>
2009-12-16 19:25:36 -07:00
Bruno Haible a3255b1b98 New module 'fd-safer-flag'. 2009-12-11 20:59:01 +01:00