mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
sd-event: several follow-ups for recent change (#39743)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1075,7 +1075,7 @@ static int exit_on_idle_defer_handler(sd_event_source *s, void *userdata) {
|
||||
|
||||
/* Disable ourselves, which should trigger exit-on-idle after the second iteration */
|
||||
if (*c == 2)
|
||||
sd_event_source_set_enabled(s, SD_EVENT_OFF);
|
||||
ASSERT_OK(sd_event_source_set_enabled(s, SD_EVENT_OFF));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user