various: remove unnecessary check before sd_event_source_set_enabled()

sd_event_source_set_enabled() does the same check internally.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2024-05-30 12:11:58 +02:00
parent acddb3cb79
commit a3ada90a37
6 changed files with 10 additions and 24 deletions
+1 -3
View File
@@ -514,7 +514,6 @@ static void timer_enter_waiting(Timer *t, bool time_change) {
goto fail;
}
} else {
r = sd_event_add_time(
UNIT(t)->manager->event,
&t->monotonic_event_source,
@@ -529,8 +528,7 @@ static void timer_enter_waiting(Timer *t, bool time_change) {
(void) sd_event_source_set_description(t->monotonic_event_source, "timer-monotonic");
}
} else if (t->monotonic_event_source) {
} else {
r = sd_event_source_set_enabled(t->monotonic_event_source, SD_EVENT_OFF);
if (r < 0) {
log_unit_warning_errno(UNIT(t), r, "Failed to disable monotonic event source: %m");