move uloop_process_delete call to get rid of an unnecessary check
authorFelix Fietkau <nbd@openwrt.org>
Tue, 30 Oct 2012 00:12:35 +0000 (01:12 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 30 Oct 2012 00:22:08 +0000 (01:22 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
main.c

diff --git a/main.c b/main.c
index 7630a8f76225c937ef8aaed1059f9dc2a70ad49c..cb9fa1666ff17b154b41499bb4c27f065b6660a2 100644 (file)
--- a/main.c
+++ b/main.c
@@ -54,8 +54,6 @@ static bool use_syslog = true;
 static void
 netifd_delete_process(struct netifd_process *proc)
 {
-       if (proc->uloop.pending)
-               uloop_process_delete(&proc->uloop);
        list_del(&proc->list);
        ustream_free(&proc->log.stream);
        close(proc->log.fd.fd);
@@ -193,6 +191,7 @@ netifd_kill_process(struct netifd_process *proc)
                return;
 
        kill(proc->uloop.pid, SIGKILL);
+       uloop_process_delete(&proc->uloop);
        netifd_delete_process(proc);
 }