summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/getaddrinfo.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-08-23 13:59:47 +0000
committerjilles <jilles@FreeBSD.org>2013-08-23 13:59:47 +0000
commitd2eb50cd0ca5fb81f2abdfd917bf5c0ce0fe9ac7 (patch)
treed650118b386b9cb389244a97e437c1de9f858ca2 /lib/libc/net/getaddrinfo.c
parent6d81dda61eb6274ed572fd3fdecf93ea3d0c679f (diff)
downloadFreeBSD-src-d2eb50cd0ca5fb81f2abdfd917bf5c0ce0fe9ac7.zip
FreeBSD-src-d2eb50cd0ca5fb81f2abdfd917bf5c0ce0fe9ac7.tar.gz
libc: Make various internal file descriptors from fopen() close-on-exec.
Diffstat (limited to 'lib/libc/net/getaddrinfo.c')
-rw-r--r--lib/libc/net/getaddrinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index d11ff78..c6af6d8 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -2240,7 +2240,7 @@ static void
_sethtent(FILE **hostf)
{
if (!*hostf)
- *hostf = fopen(_PATH_HOSTS, "r");
+ *hostf = fopen(_PATH_HOSTS, "re");
else
rewind(*hostf);
}
@@ -2264,7 +2264,7 @@ _gethtent(FILE **hostf, const char *name, const struct addrinfo *pai)
const char *addr;
char hostbuf[8*1024];
- if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "r")))
+ if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "re")))
return (NULL);
again:
if (!(p = fgets(hostbuf, sizeof hostbuf, *hostf)))
OpenPOWER on IntegriCloud