summaryrefslogtreecommitdiffstats
path: root/control.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-01-15 09:58:21 +0000
committerRoy Marples <roy@marples.name>2009-01-15 09:58:21 +0000
commit6e0a88da1c424e2f521a000ffccf747767c41916 (patch)
treefb2bb1773c275cf4eddd966786e595008b9cba2a /control.c
parentb66d49d3863e7ef38648ed59789bf0343a2a4798 (diff)
downloaddhcpcd-6e0a88da1c424e2f521a000ffccf747767c41916.tar.xz
We need to close our listeners before removing the socket so clients close down properly.
Diffstat (limited to 'control.c')
-rw-r--r--control.c10
1 files changed, 5 insertions, 5 deletions
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;
}