diff options
author | guenther <> | 2014-09-15 06:15:48 +0000 |
---|---|---|
committer | guenther <> | 2014-09-15 06:15:48 +0000 |
commit | 6fa5c415aa0acdbeb8a8b9beba390518489304ab (patch) | |
tree | ad712f134771158fecd87a78b6c147ee2b1a2261 /src/lib/libc/net/ethers.c | |
parent | 942d3f7f21b3d5906968b93cbb26de97a8979084 (diff) | |
download | openbsd-6fa5c415aa0acdbeb8a8b9beba390518489304ab.tar.gz openbsd-6fa5c415aa0acdbeb8a8b9beba390518489304ab.tar.bz2 openbsd-6fa5c415aa0acdbeb8a8b9beba390518489304ab.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 'src/lib/libc/net/ethers.c')
-rw-r--r-- | src/lib/libc/net/ethers.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libc/net/ethers.c b/src/lib/libc/net/ethers.c index af31bb8e60..07f1da3306 100644 --- a/src/lib/libc/net/ethers.c +++ b/src/lib/libc/net/ethers.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ethers.c,v 1.21 2013/11/24 23:51:28 deraadt Exp $ */ | 1 | /* $OpenBSD: ethers.c,v 1.22 2014/09/15 06:15:48 guenther Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> | 4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> |
@@ -112,7 +112,7 @@ ether_ntohost(char *hostname, struct ether_addr *e) | |||
112 | trylen = strlen(trybuf); | 112 | trylen = strlen(trybuf); |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | f = fopen(_PATH_ETHERS, "r"); | 115 | f = fopen(_PATH_ETHERS, "re"); |
116 | if (f == NULL) | 116 | if (f == NULL) |
117 | return (-1); | 117 | return (-1); |
118 | while ((p = fgetln(f, &len)) != NULL) { | 118 | while ((p = fgetln(f, &len)) != NULL) { |
@@ -165,7 +165,7 @@ ether_hostton(const char *hostname, struct ether_addr *e) | |||
165 | int hostlen = strlen(hostname); | 165 | int hostlen = strlen(hostname); |
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | f = fopen(_PATH_ETHERS, "r"); | 168 | f = fopen(_PATH_ETHERS, "re"); |
169 | if (f==NULL) | 169 | if (f==NULL) |
170 | return (-1); | 170 | return (-1); |
171 | 171 | ||