]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-event: use LIST_IS_EMPTY()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 25 Jun 2022 21:41:33 +0000 (06:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 27 Jun 2022 15:05:14 +0000 (00:05 +0900)
src/libsystemd/sd-event/sd-event.c

index e5d370d4f3c1259c076f5fbf98e8948e4c23769c..78b4351c2a3977f90c83c8e4a1301731bbf85756 100644 (file)
@@ -1799,7 +1799,7 @@ static void event_free_inode_data(
         if (!d)
                 return;
 
-        assert(!d->event_sources);
+        assert(LIST_IS_EMPTY(d->event_sources));
 
         if (d->fd >= 0) {
                 LIST_REMOVE(to_close, e->inode_data_to_close, d);
@@ -1862,7 +1862,7 @@ static void event_gc_inode_data(
         if (!d)
                 return;
 
-        if (d->event_sources)
+        if (!LIST_IS_EMPTY(d->event_sources))
                 return;
 
         inotify_data = d->inotify_data;
@@ -3954,7 +3954,7 @@ static int process_epoll(sd_event *e, usec_t timeout, int64_t threshold, int64_t
         n_event_max = MALLOC_ELEMENTSOF(e->event_queue);
 
         /* If we still have inotify data buffered, then query the other fds, but don't wait on it */
-        if (e->inotify_data_buffered)
+        if (!LIST_IS_EMPTY(e->inotify_data_buffered))
                 timeout = 0;
 
         for (;;) {