This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Open /etc/resolv.conf with FD_CLOEXEC


Hello,

As per the comment for 312be3f9f, "c" and "e" should always be used for
internal fopen usage. This patch adds "e" for /etc/resolv.conf.

Ross

2011-11-21  Ross Lagerwall  <rosslagerwall@gmail.com>

	* resolv/res_init.c (__res_vinit): Open /etc/resolv.conf with
	FD_CLOEXEC.
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 73caaa4..c58c763 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 */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]