chiark / gitweb /
udev: use initialization instead of zeroing in one place
[elogind.git] / src / udev / udevd.c
index fd799cc910cacd19b9d73002aef78f62616eb799..1c2d00f03b2e3af25c6dc4d12e90dc8759839d68 100644 (file)
@@ -314,10 +314,12 @@ static void worker_new(struct event *event)
                         udev_device_unref(dev);
                         dev = NULL;
 
-                        udev_event_unref(udev_event);
-
-                        if (udev_event->sigterm)
+                        if (udev_event->sigterm) {
+                                udev_event_unref(udev_event);
                                 goto out;
+                        }
+
+                        udev_event_unref(udev_event);
 
                         /* wait for more device messages from main udevd, or term signal */
                         while (dev == NULL) {
@@ -777,10 +779,11 @@ static void handle_signal(struct udev *udev, int signo)
 
                                 if (WIFEXITED(status)) {
                                         if (WEXITSTATUS(status) != 0)
-                                                log_error("worker [%u] exit with return code %i\n", pid, WEXITSTATUS(status));
+                                                log_error("worker [%u] exit with return code %i\n",
+                                                          pid, WEXITSTATUS(status));
                                 } else if (WIFSIGNALED(status)) {
                                         log_error("worker [%u] terminated by signal %i (%s)\n",
-                                            pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
+                                                  pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
                                 } else if (WIFSTOPPED(status)) {
                                         log_error("worker [%u] stopped\n", pid);
                                 } else if (WIFCONTINUED(status)) {