diff options
author | 2014-09-15 06:15:48 +0000 | |
---|---|---|
committer | 2014-09-15 06:15:48 +0000 | |
commit | 241db05998f1091df691c528a16b6ca3ab8719d3 (patch) | |
tree | 3f038d1b6f858c1d54403aea4e05196b78947f43 /lib/libc/asr/getnetnamadr_async.c | |
parent | Pass O_CLOEXEC to open() or mkostemp() instead of setting FD_CLOEXEC afterwards (diff) | |
download | wireguard-openbsd-241db05998f1091df691c528a16b6ca3ab8719d3.tar.xz wireguard-openbsd-241db05998f1091df691c528a16b6ca3ab8719d3.zip |
When fopen()ing internal to libc (the API doesn't support the use
of the resulting FILE *), then pass fopen() the 'e' mode letter to
mark it close-on-exec.
ok miod@
Diffstat (limited to 'lib/libc/asr/getnetnamadr_async.c')
-rw-r--r-- | lib/libc/asr/getnetnamadr_async.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/asr/getnetnamadr_async.c b/lib/libc/asr/getnetnamadr_async.c index 53147ed8fc5..f31168ef005 100644 --- a/lib/libc/asr/getnetnamadr_async.c +++ b/lib/libc/asr/getnetnamadr_async.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getnetnamadr_async.c,v 1.17 2014/09/15 06:03:39 guenther Exp $ */ +/* $OpenBSD: getnetnamadr_async.c,v 1.18 2014/09/15 06:15:48 guenther Exp $ */ /* * Copyright (c) 2012 Eric Faurot <eric@openbsd.org> * @@ -178,7 +178,7 @@ getnetnamadr_async_run(struct asr_query *as, struct asr_result *ar) case ASR_DB_FILE: - if ((f = fopen(_PATH_NETWORKS, "r")) == NULL) + if ((f = fopen(_PATH_NETWORKS, "re")) == NULL) break; if (as->as_type == ASR_GETNETBYNAME) |