]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
control: when closing, remove from eloop.
authorRoy Marples <roy@marples.name>
Fri, 1 Nov 2019 23:29:06 +0000 (23:29 +0000)
committerRoy Marples <roy@marples.name>
Fri, 1 Nov 2019 23:29:06 +0000 (23:29 +0000)
src/control.c

index 4ae227931636eff3d663f9207db97aadc39f53ca..8825a3620dbbc769cb9260e895d6434e76b55072 100644 (file)
@@ -274,9 +274,8 @@ control_stop(struct dhcpcd_ctx *ctx)
 
        if (ctx->control_fd == -1)
                return 0;
-       eloop_event_delete(ctx->eloop, ctx->control_fd);
-       close(ctx->control_fd);
-       ctx->control_fd = -1;
+
+       control_close(ctx);
        if (unlink(ctx->control_sock) == -1)
                retval = -1;
 
@@ -455,6 +454,7 @@ control_close(struct dhcpcd_ctx *ctx)
 {
 
        if (ctx->control_fd != -1) {
+               eloop_event_delete(ctx->eloop, ctx->control_fd);
                close(ctx->control_fd);
                ctx->control_fd = -1;
        }