Hash :
e4ee1420
Author :
Date :
2009-12-16T10:07:13
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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Description:
fchdir() function: change current directory, given an open file descriptor.
Files:
lib/fchdir.c
m4/fchdir.m4
Depends-on:
close
dirent
dirfd
dup2
fcntl
fcntl-h
include_next
malloc-posix
open
realloc-posix
stat
stdbool
strdup-posix
sys_stat
unistd
configure.ac:
gl_FUNC_FCHDIR
gl_UNISTD_MODULE_INDICATOR([fchdir])
Makefile.am:
Include:
<unistd.h>
License:
LGPL
Maintainer:
Bruno Haible