comparison modules/fd-safer-flag @ 12457:2a3833485e1c

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>
author Eric Blake <ebb9@byu.net>
date Wed, 16 Dec 2009 10:07:13 -0700
parents 0759131e0d13
children
comparison
equal deleted inserted replaced
12456:f3aceada3c52 12457:2a3833485e1c
5 Files: 5 Files:
6 lib/fd-safer-flag.c 6 lib/fd-safer-flag.c
7 lib/dup-safer-flag.c 7 lib/dup-safer-flag.c
8 8
9 Depends-on: 9 Depends-on:
10 cloexec
11 fcntl
10 unistd-safer 12 unistd-safer
11 cloexec
12 13
13 configure.ac: 14 configure.ac:
14 gl_MODULE_INDICATOR([fd-safer-flag]) 15 gl_MODULE_INDICATOR([fd-safer-flag])
15 16
16 Makefile.am: 17 Makefile.am: