about summary refs log tree commit diff
path: root/ChangeLog
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-15 15:28:46 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-15 15:28:46 -0400
commit94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf (patch)
tree2ddc8ca200024ecca3faf0f2efffaea15e21a04f /ChangeLog
parentbd25564e1e98910ed69043ed6a6f884ce60e5780 (diff)
downloadglibc-94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf.tar.gz
glibc-94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf.tar.xz
glibc-94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf.zip
Fix a few problems in fopen and freopen
fopen should set the FD_CLOEXEC flag if requested evenif the kernel does
not support an aotmic operation.

freopen should reuse the file descriptor for the stream.  This is
especially important for calls to change the standard streams (stin,
stdout, stderr).
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog16
1 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c0aa6a2ff..1cb8f4fc2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2011-05-15  Ulrich Drepper  <drepper@gmail.com>
 
+	* libio/freopen.c (freopen): Don't close old file descriptor
+	before the new one is opened.  Instead dup the new file descriptor
+	to the old one after the new stream is created.
+	* libio/freopen64.c (freopen64): Likewise.
+	* libio/libio.h: Define _IO_FLAGS2_NOCLOSE and _IO_FLAGS2_CLOEXEC.
+	* libio/fileops.c (_IO_new_file_close_it): Handle new
+	_IO_FLAGS2_NOCLOSE flag.
+	(_IO_new_file_fopen): Set _IO_FLAGS2_CLOEXEC for "e" mode.
+	If _IO_file_open didn't set FD_CLOEXEC do it after the call.
+	* libio/oldfileops.c (_IO_old_file_close_it): Handle new
+	_IO_FLAGS2_NOCLOSE flag.
+	* include/unistd.h: Add hidden_proto for dup3.
+	Define __have_dup3.
+	* io/dup3.c: Define hidden symbol.
+	* sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_DUP3.
+
 	[BZ #7101]
 	* posix/getopt.c (_getopt_internal_r): List all ambigious possibilities
 	when an incomplete long option is used.