]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
We need to close our listeners before removing the socket so clients close down properly.
authorRoy Marples <roy@marples.name>
Thu, 15 Jan 2009 09:58:21 +0000 (09:58 +0000)
committerRoy Marples <roy@marples.name>
Thu, 15 Jan 2009 09:58:21 +0000 (09:58 +0000)
control.c

index 751208260fe817d076e3bceaf390e68f9fa9b7ce..1e6141457189a2887aab6623f18ff0009b035f3e 100644 (file)
--- 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;
 }