Prevent a close(0) in free_muxlist().

Fixes sy{mux,mon} reconfiguration w/ SIGHUP.

Confirmed by Willem Dijkstra, OK henning@
This commit is contained in:
mpf 2007-06-20 17:11:34 +00:00
parent 7d0d0ae02a
commit 0cc7b2917c

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-lib_data_c,v 1.1 2007/06/20 17:11:34 mpf Exp $
--- lib/data.c.orig Wed Jun 20 09:57:02 2007
+++ lib/data.c Wed Jun 20 09:58:46 2007
@@ -862,8 +862,10 @@ free_muxlist(struct muxlist * mul)
if (p->port != NULL)
xfree(p->port);
- close(p->clientsocket);
- close(p->symuxsocket);
+ if (p->clientsocket)
+ close(p->clientsocket);
+ if (p->symuxsocket)
+ close(p->symuxsocket);
for (i = 0; i < AF_MAX; i++)
if (p->symonsocket[i])
close(p->symonsocket[i]);