summaryrefslogtreecommitdiffstats
path: root/libc/dns/net
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-08-26 15:56:54 -0700
committerElliott Hughes <enh@google.com>2014-08-26 15:56:54 -0700
commitc674edbf27450bbb2396b1434421b1db5325d8f4 (patch)
tree31855742fc4370e2573f29a706a8223aa4d46edf /libc/dns/net
parentc764fb24ccb47e05d8e140cde5b4111225790ef1 (diff)
downloadbionic-c674edbf27450bbb2396b1434421b1db5325d8f4.zip
bionic-c674edbf27450bbb2396b1434421b1db5325d8f4.tar.gz
bionic-c674edbf27450bbb2396b1434421b1db5325d8f4.tar.bz2
libc should use O_CLOEXEC when opening files for its own use.
Change-Id: I159f1d57e0ca090d837f57854fcef5879b8b8248
Diffstat (limited to 'libc/dns/net')
-rw-r--r--libc/dns/net/getaddrinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c
index 65fd1c1..a492318 100644
--- a/libc/dns/net/getaddrinfo.c
+++ b/libc/dns/net/getaddrinfo.c
@@ -2017,7 +2017,7 @@ _sethtent(FILE **hostf)
{
if (!*hostf)
- *hostf = fopen(_PATH_HOSTS, "r" );
+ *hostf = fopen(_PATH_HOSTS, "re");
else
rewind(*hostf);
}
@@ -2046,7 +2046,7 @@ _gethtent(FILE **hostf, const char *name, const struct addrinfo *pai)
assert(name != NULL);
assert(pai != NULL);
- if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "r" )))
+ if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "re")))
return (NULL);
again:
if (!(p = fgets(hostbuf, sizeof hostbuf, *hostf)))