From: Roy Marples Date: Thu, 15 Jan 2009 09:58:21 +0000 (+0000) Subject: We need to close our listeners before removing the socket so clients close down properly. X-Git-Tag: v5.0.0~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e0a88da1c424e2f521a000ffccf747767c41916;p=thirdparty%2Fdhcpcd.git We need to close our listeners before removing the socket so clients close down properly. --- diff --git a/control.c b/control.c index 75120826..1e614145 100644 --- a/control.c +++ b/control.c @@ -152,11 +152,6 @@ stop_control(void) struct fd_list *l, *ll; delete_event(fd); - if (close(fd) == -1) - retval = 1; - fd = -1; - if (unlink(CONTROLSOCKET) == -1) - retval = -1; l = fds; while (l != NULL) { ll = l->next; @@ -165,6 +160,11 @@ stop_control(void) free(l); l = ll; } + if (close(fd) == -1) + retval = 1; + fd = -1; + if (unlink(CONTROLSOCKET) == -1) + retval = -1; return retval; }