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/gethostnamadr_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/gethostnamadr_async.c')
-rw-r--r-- | lib/libc/asr/gethostnamadr_async.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/asr/gethostnamadr_async.c b/lib/libc/asr/gethostnamadr_async.c index 218c055b7e4..82614f29cde 100644 --- a/lib/libc/asr/gethostnamadr_async.c +++ b/lib/libc/asr/gethostnamadr_async.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gethostnamadr_async.c,v 1.30 2014/07/23 21:26:25 eric Exp $ */ +/* $OpenBSD: gethostnamadr_async.c,v 1.31 2014/09/15 06:15:48 guenther Exp $ */ /* * Copyright (c) 2012 Eric Faurot <eric@openbsd.org> * @@ -247,7 +247,7 @@ gethostnamadr_async_run(struct asr_query *as, struct asr_result *ar) /* Try to find a match in the host file */ - if ((f = fopen(as->as_ctx->ac_hostfile, "r")) == NULL) + if ((f = fopen(as->as_ctx->ac_hostfile, "re")) == NULL) break; if (as->as_type == ASR_GETHOSTBYNAME) { |