summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2004-04-03 10:21:19 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2004-04-03 10:21:19 +0000
commita506f3ad28648edc2b304ccdf0cbd2cfb346b5d7 (patch)
tree185f59305df68b841c34cd9de88ea0117bbc25eb
parent117e324e20911fbfec77141636db44afc9650cab (diff)
dont close an invalid fd, canacar@ ok
-rw-r--r--sbin/pflogd/privsep.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/pflogd/privsep.c b/sbin/pflogd/privsep.c
index 50807ada4e4..842c8a40a50 100644
--- a/sbin/pflogd/privsep.c
+++ b/sbin/pflogd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.8 2004/03/14 19:17:05 otto Exp $ */
+/* $OpenBSD: privsep.c,v 1.9 2004/04/03 10:21:18 avsm Exp $ */
/*
* Copyright (c) 2003 Can Erkin Acar
@@ -147,12 +147,13 @@ priv_init(void)
fd = open(filename,
O_RDWR|O_CREAT|O_APPEND|O_NONBLOCK|O_NOFOLLOW,
0600);
+ send_fd(socks[0], fd);
if (fd < 0)
logmsg(LOG_NOTICE,
"[priv]: failed to open %s: %s",
filename, strerror(errno));
- send_fd(socks[0], fd);
- close(fd);
+ else
+ close(fd);
break;
default: