]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-event: don't consider no pending IO event a programming error in sd_event_source_g...
authorLennart Poettering <lennart@poettering.net>
Tue, 25 Mar 2025 20:43:15 +0000 (16:43 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Apr 2025 19:07:44 +0000 (04:07 +0900)
src/libsystemd/sd-event/sd-event.c

index 599a81d64a2db8e6023865476a563b08874a1594..8a79867a194b1f0c11a857fd7fa1afa0a64a4f77 100644 (file)
@@ -2725,9 +2725,11 @@ _public_ int sd_event_source_get_io_revents(sd_event_source *s, uint32_t *ret) {
         assert_return(s, -EINVAL);
         assert_return(ret, -EINVAL);
         assert_return(s->type == SOURCE_IO, -EDOM);
-        assert_return(s->pending, -ENODATA);
         assert_return(!event_origin_changed(s->event), -ECHILD);
 
+        if (!s->pending)
+                return -ENODATA;
+
         *ret = s->io.revents;
         return 0;
 }