openbsd-ports/sysutils/symon/patches/patch-lib_data_c
mpf 0cc7b2917c Prevent a close(0) in free_muxlist().
Fixes sy{mux,mon} reconfiguration w/ SIGHUP.

Confirmed by Willem Dijkstra, OK henning@
2007-06-20 17:11:34 +00:00

17 lines
579 B
Plaintext

$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]);