]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: Remove fd's from event loop and ensure all closed.
authorRoy Marples <roy@marples.name>
Tue, 14 Jan 2020 11:53:05 +0000 (11:53 +0000)
committerRoy Marples <roy@marples.name>
Tue, 14 Jan 2020 11:53:05 +0000 (11:53 +0000)
src/privsep.c

index 8ff34a25364b4a85264e04e9bc88265a52ffa22a..0610f03d62eac362ab08d888769f8b520f9a8f8c 100644 (file)
@@ -347,8 +347,14 @@ ps_freeprocess(struct ps_process *psp)
 #endif
 
        TAILQ_REMOVE(&psp->psp_ctx->ps_processes, psp, next);
-       if (psp->psp_fd != -1)
+       if (psp->psp_fd != -1) {
+               eloop_event_delete(psp->psp_ctx->eloop, psp->psp_fd);
                close(psp->psp_fd);
+       }
+       if (psp->psp_work_fd != -1) {
+               eloop_event_delete(psp->psp_ctx->eloop, psp->psp_work_fd);
+               close(psp->psp_work_fd);
+       }
        free(psp);
 }