chiark / gitweb /
udevd: don't free event when killing the worker, wait until it has been reaped
authorTom Gundersen <teg@jklm.no>
Wed, 11 Mar 2015 21:27:46 +0000 (22:27 +0100)
committerTom Gundersen <teg@jklm.no>
Thu, 12 Mar 2015 11:03:50 +0000 (12:03 +0100)
This will allow us to clean up the device when we are notified about the worker being killed.

src/udev/udevd.c

index c01fb4b..9426edc 100644 (file)
@@ -1414,12 +1414,8 @@ int main(int argc, char *argv[]) {
                                                 kill(worker->pid, SIGKILL);
                                                 worker->state = WORKER_KILLED;
 
-                                                /* drop reference taken for state 'running' */
-                                                worker_unref(worker);
                                                 log_error("seq %llu '%s' killed", udev_device_get_seqnum(worker->event->dev), worker->event->devpath);
                                                 worker->event->exitcode = -64;
-                                                event_queue_delete(worker->event);
-                                                worker->event = NULL;
                                         } else if (!worker->event_warned) {
                                                 log_warning("worker ["PID_FMT"] %s is taking a long time", worker->pid, worker->event->devpath);
                                                 worker->event_warned = true;