Hash :
b947d052
Author :
Date :
2016-11-26T14:53:29
freopen: work around glibc bug with closed fd Work around glibc bug#15589, where freopen mishandles the case where stdin etc. are already closed. * doc/posix-functions/freopen.texi (freopen): Document the bug. * lib/freopen.c (_GL_ALREADY_INCLUDING_STDIO_H): Define this instead of __need_FILE, as the latter does not work with glibc. Include <fcntl.h>, for open flags. (rpl_freopen): Work around glibc bug. * m4/freopen.m4 (gl_FUNC_FREOPEN): Check for bug. * modules/freopen (Depends-on): Add fcntl-h. * tests/test-freopen.c (main): Test for bug.
Description:
freopen() function: open a stream to a file.
Files:
lib/freopen.c
m4/freopen.m4
Depends-on:
fcntl-h [test $REPLACE_FREOPEN = 1]
stdio
largefile
configure.ac:
gl_FUNC_FREOPEN
if test $REPLACE_FREOPEN = 1; then
AC_LIBOBJ([freopen])
gl_PREREQ_FREOPEN
fi
gl_STDIO_MODULE_INDICATOR([freopen])
Makefile.am:
Include:
<stdio.h>
License:
LGPL
Maintainer:
all