]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-event: update state at the end in event_source_enable
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Nov 2020 09:38:37 +0000 (10:38 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Nov 2020 13:18:47 +0000 (14:18 +0100)
commitd2eafe61ca07f8300dc741a0491a914213fa2b6b
tree9262731c7195ad370d8a325535a4b6a997712d6a
parentb8aac5014c7dec215bac42007be2ee6ded0d5c56
sd-event: update state at the end in event_source_enable

Coverity in CID#1435966 was complaining that s->enabled is not "restored" in
all cases. But the code was actually correct, since it should only be
"restored" in the error paths. But let's still make this prettier by not setting
the state before all operations that may fail are done.

We need to set .enabled for the prioq reshuffling operations, so move those down.

No functional change intended.
src/libsystemd/sd-event/sd-event.c