summaryrefslogtreecommitdiff
path: root/src/udev/udevd.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-08 17:45:01 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-11-17 21:45:03 +0900
commitba47b71c2dadf5c8301b775b0ef0ae97545520f4 (patch)
tree6fedfe8b9dcd9e768a6ff8afea99126d848b5902 /src/udev/udevd.c
parentd8f462b43536bd94b519ef04e75b480c46e3e20b (diff)
downloadsystemd-ba47b71c2dadf5c8301b775b0ef0ae97545520f4.tar.gz
udevd: decrease indentation
Diffstat (limited to 'src/udev/udevd.c')
-rw-r--r--src/udev/udevd.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 58e3011fa3..49842b60a9 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -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);
}