Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2012 22:52:57 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244126 - head/lib/libc/locale
Message-ID:  <201212112252.qBBMqvH9011176@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Tue Dec 11 22:52:56 2012
New Revision: 244126
URL: http://svnweb.freebsd.org/changeset/base/244126

Log:
  libc: Make various internal file descriptors close-on-exec.
  
  These are obtained via fopen().

Modified:
  head/lib/libc/locale/collate.c
  head/lib/libc/locale/setrunelocale.c

Modified: head/lib/libc/locale/collate.c
==============================================================================
--- head/lib/libc/locale/collate.c	Tue Dec 11 20:38:53 2012	(r244125)
+++ head/lib/libc/locale/collate.c	Tue Dec 11 22:52:56 2012	(r244126)
@@ -135,7 +135,7 @@ __collate_load_tables_l(const char *enco
 	(void)strcat(buf, "/");
 	(void)strcat(buf, encoding);
 	(void)strcat(buf, "/LC_COLLATE");
-	if ((fp = fopen(buf, "r")) == NULL)
+	if ((fp = fopen(buf, "re")) == NULL)
 		return (_LDP_ERROR);
 
 	if (fread(strbuf, sizeof(strbuf), 1, fp) != 1) {

Modified: head/lib/libc/locale/setrunelocale.c
==============================================================================
--- head/lib/libc/locale/setrunelocale.c	Tue Dec 11 20:38:53 2012	(r244125)
+++ head/lib/libc/locale/setrunelocale.c	Tue Dec 11 22:52:56 2012	(r244126)
@@ -129,7 +129,7 @@ __setrunelocale(struct xlocale_ctype *l,
 	(void) strcat(name, encoding);
 	(void) strcat(name, "/LC_CTYPE");
 
-	if ((fp = fopen(name, "r")) == NULL)
+	if ((fp = fopen(name, "re")) == NULL)
 		return (errno == 0 ? ENOENT : errno);
 
 	if ((rl = _Read_RuneMagi(fp)) == NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212112252.qBBMqvH9011176>