From e5f7ee6f17aecaa514bc18445c9e3eda25a94187 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Sat, 3 Apr 2004 10:21:58 +0000 Subject: dont try to close an invalid fd, canacar@ ok --- usr.sbin/bind/lib/isc/unix/privsep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.sbin/bind/lib/isc/unix') 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 @@ -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 */ -- cgit v1.2.3