summaryrefslogtreecommitdiff
path: root/usr.sbin/bind
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2004-04-03 10:21:58 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2004-04-03 10:21:58 +0000
commite5f7ee6f17aecaa514bc18445c9e3eda25a94187 (patch)
treebb2953bed8e443b0b9d741915c6b39b3987a72f0 /usr.sbin/bind
parenta506f3ad28648edc2b304ccdf0cbd2cfb346b5d7 (diff)
dont try to close an invalid fd, canacar@ ok
Diffstat (limited to 'usr.sbin/bind')
-rw-r--r--usr.sbin/bind/lib/isc/unix/privsep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bind/lib/isc/unix/privsep.c b/usr.sbin/bind/lib/isc/unix/privsep.c
index 8e186436b87..65438fb6577 100644
--- a/usr.sbin/bind/lib/isc/unix/privsep.c
+++ b/usr.sbin/bind/lib/isc/unix/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.2 2004/03/19 20:36:28 canacar Exp $ */
+/* $OpenBSD: privsep.c,v 1.3 2004/04/03 10:21:57 avsm Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
@@ -222,7 +222,8 @@ parent_bind(int fd)
must_write(fd, &er, sizeof(er));
must_write(fd, &status, sizeof(status));
- close(sock);
+ if (sock >= 0)
+ close(sock);
}
/* Bind to allowed privileged ports using privsep, or try to bind locally */