summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/getservent.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/getservent.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/getservent.c')
-rw-r--r--lib/libc/net/getservent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c
index 3228bdc..005de98 100644
--- a/lib/libc/net/getservent.c
+++ b/lib/libc/net/getservent.c
@@ -335,7 +335,7 @@ files_servent(void *retval, void *mdata, va_list ap)
if (st->fp == NULL)
st->compat_mode_active = 0;
- if (st->fp == NULL && (st->fp = fopen(_PATH_SERVICES, "r")) == NULL) {
+ if (st->fp == NULL && (st->fp = fopen(_PATH_SERVICES, "re")) == NULL) {
*errnop = errno;
return (NS_UNAVAIL);
}
@@ -449,7 +449,7 @@ files_setservent(void *retval, void *mdata, va_list ap)
case SETSERVENT:
f = va_arg(ap,int);
if (st->fp == NULL)
- st->fp = fopen(_PATH_SERVICES, "r");
+ st->fp = fopen(_PATH_SERVICES, "re");
else
rewind(st->fp);
st->stayopen |= f;
OpenPOWER on IntegriCloud