From 6fa5c415aa0acdbeb8a8b9beba390518489304ab Mon Sep 17 00:00:00 2001 From: guenther <> Date: Mon, 15 Sep 2014 06:15:48 +0000 Subject: 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@ --- src/lib/libc/net/ethers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libc/net/ethers.c') 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 @@ -/* $OpenBSD: ethers.c,v 1.21 2013/11/24 23:51:28 deraadt Exp $ */ +/* $OpenBSD: ethers.c,v 1.22 2014/09/15 06:15:48 guenther Exp $ */ /* * Copyright (c) 1998 Todd C. Miller @@ -112,7 +112,7 @@ ether_ntohost(char *hostname, struct ether_addr *e) trylen = strlen(trybuf); #endif - f = fopen(_PATH_ETHERS, "r"); + f = fopen(_PATH_ETHERS, "re"); if (f == NULL) return (-1); while ((p = fgetln(f, &len)) != NULL) { @@ -165,7 +165,7 @@ ether_hostton(const char *hostname, struct ether_addr *e) int hostlen = strlen(hostname); #endif - f = fopen(_PATH_ETHERS, "r"); + f = fopen(_PATH_ETHERS, "re"); if (f==NULL) return (-1); -- cgit v1.2.3-55-g6feb