summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2011-12-17 14:43:40 -0500
committerUlrich Drepper <drepper@gmail.com>2011-12-17 14:43:40 -0500
commitad8ac1bd6a3db5becaf1dc20394f6e682d7828cc (patch)
tree91e27ee99d949b25030156f40ee38d73086c52a0
parent370a7d88f724d245536becd707ffb9666bb62933 (diff)
downloadglibc-ad8ac1bd6a3db5becaf1dc20394f6e682d7828cc.tar.gz
glibc-ad8ac1bd6a3db5becaf1dc20394f6e682d7828cc.tar.xz
glibc-ad8ac1bd6a3db5becaf1dc20394f6e682d7828cc.zip
Open /etc/resolv.conf with FD_CLOEXEC
-rw-r--r--ChangeLog5
-rw-r--r--resolv/res_init.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 19f2cde6b0..7c5ac8d49e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-21  Ross Lagerwall  <rosslagerwall@gmail.com>
+
+	* resolv/res_init.c (__res_vinit): Open /etc/resolv.conf with
+	FD_CLOEXEC.
+
 2011-11-14  Liubov Dmitrieva  <liubov.dmitrieva@gmail.com>
 
 	* sysdeps/x86_64/multiarch/Makefile [subdir=wcsmbs] (sysdep_routines):
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 73caaa4c5e..c58c763841 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -233,7 +233,7 @@ __res_vinit(res_state statp, int preinit) {
 	(line[sizeof(name) - 1] == ' ' || \
 	 line[sizeof(name) - 1] == '\t'))
 
-	if ((fp = fopen(_PATH_RESCONF, "rc")) != NULL) {
+	if ((fp = fopen(_PATH_RESCONF, "rce")) != NULL) {
 	    /* No threads use this stream.  */
 	    __fsetlocking (fp, FSETLOCKING_BYCALLER);
 	    /* read the config file */