diff options
author | 2004-04-08 14:32:47 +0000 | |
---|---|---|
committer | 2004-04-08 14:32:47 +0000 | |
commit | 72e2664b58364173654bbb6202381f054bad4a48 (patch) | |
tree | 5419429752b49ca2955a6bfb1d249c0f89ebcb6c | |
parent | only close fd if its valid, from Moritz Jodeit <moritz at jodeit.org> (diff) | |
download | wireguard-openbsd-72e2664b58364173654bbb6202381f054bad4a48.tar.xz wireguard-openbsd-72e2664b58364173654bbb6202381f054bad4a48.zip |
sigh, really fix the error message this time, thanks Moritz Jodeit
-rw-r--r-- | sbin/pflogd/privsep.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/pflogd/privsep.c b/sbin/pflogd/privsep.c index f859c60e3a4..c21f41895fe 100644 --- a/sbin/pflogd/privsep.c +++ b/sbin/pflogd/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.10 2004/04/08 12:26:06 avsm Exp $ */ +/* $OpenBSD: privsep.c,v 1.11 2004/04/08 14:32:47 avsm Exp $ */ /* * Copyright (c) 2003 Can Erkin Acar @@ -67,7 +67,7 @@ int priv_init(void) { int i, fd, socks[2], cmd; - int snaplen, ret; + int snaplen, ret, olderrno; struct passwd *pw; for (i = 1; i < _NSIG; i++) @@ -147,13 +147,14 @@ priv_init(void) fd = open(filename, O_RDWR|O_CREAT|O_APPEND|O_NONBLOCK|O_NOFOLLOW, 0600); + olderrno = errno; + send_fd(socks[0], fd); if (fd < 0) logmsg(LOG_NOTICE, "[priv]: failed to open %s: %s", - filename, strerror(errno)); + filename, strerror(olderrno)); else close(fd); - send_fd(socks[0], fd); break; default: |