sd-event: do not ignore result of callbacks

Follow-up for 4c8b6d636c and
6aff6d3ffc.
Fixes CID#1643218 and friends.
This commit is contained in:
Yu Watanabe
2025-11-16 05:44:35 +09:00
parent c9fc7eb87e
commit 8e4ef4a18c
+6 -6
View File
@@ -4249,12 +4249,6 @@ static int source_dispatch(sd_event_source *s) {
s->dispatching = false;
/* More post sources might have been added while executing the callback, let's make sure
* those are marked pending as well. */
r = maybe_mark_post_sources_pending(saved_type, saved_event);
if (r < 0)
return r;
finish:
if (r < 0) {
log_debug_errno(r, "Event source %s (type %s) returned error, %s: %m",
@@ -4271,6 +4265,12 @@ finish:
else if (r < 0)
assert_se(sd_event_source_set_enabled(s, SD_EVENT_OFF) >= 0);
/* More post sources might have been added while executing the callback, let's make sure
* those are marked pending as well. */
r = maybe_mark_post_sources_pending(saved_type, saved_event);
if (r < 0)
return r;
return 1;
}