diff options
| author | guenther <> | 2014-09-15 06:15:48 +0000 | 
|---|---|---|
| committer | guenther <> | 2014-09-15 06:15:48 +0000 | 
| commit | 7e9937d6e8784a350351cd8743feb02a8f325b83 (patch) | |
| tree | ad712f134771158fecd87a78b6c147ee2b1a2261 /src/lib/libc/net/ethers.c | |
| parent | 7679690e86922a2dcc0822b02ca8d15b3a8771be (diff) | |
| download | openbsd-7e9937d6e8784a350351cd8743feb02a8f325b83.tar.gz openbsd-7e9937d6e8784a350351cd8743feb02a8f325b83.tar.bz2 openbsd-7e9937d6e8784a350351cd8743feb02a8f325b83.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 | ||
