]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevd: decrease indentation
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 8 Nov 2018 08:45:01 +0000 (17:45 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 17 Nov 2018 12:45:03 +0000 (21:45 +0900)
src/udev/udevd.c

index 58e3011fa39e4bf336418ab062c25b1caa1fe651..49842b60a9eba63ed581df04bf823ebf2a4e0c8c 100644 (file)
@@ -147,10 +147,9 @@ struct worker_message {
 };
 
 static void event_free(struct event *event) {
-        int r;
-
         if (!event)
                 return;
+
         assert(event->manager);
 
         LIST_REMOVE(event, event->manager->events, event);
@@ -163,14 +162,11 @@ static void event_free(struct event *event) {
         if (event->worker)
                 event->worker->event = NULL;
 
-        if (LIST_IS_EMPTY(event->manager->events)) {
-                /* only clean up the queue from the process that created it */
-                if (event->manager->pid == getpid_cached()) {
-                        r = unlink("/run/udev/queue");
-                        if (r < 0)
-                                log_warning_errno(errno, "could not unlink /run/udev/queue: %m");
-                }
-        }
+        /* only clean up the queue from the process that created it */
+        if (LIST_IS_EMPTY(event->manager->events) &&
+            event->manager->pid == getpid_cached())
+                if (unlink("/run/udev/queue") < 0)
+                        log_warning_errno(errno, "Failed to unlink /run/udev/queue: %m");
 
         free(event);
 }