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
+3 -5
View File
@@ -472,11 +472,9 @@ static int add_connection_socket(Context *context, int fd) {
return 0;
}
if (context->idle_time) {
r = sd_event_source_set_enabled(context->idle_time, SD_EVENT_OFF);
if (r < 0)
log_warning_errno(r, "Unable to disable idle timer, continuing: %m");
}
r = sd_event_source_set_enabled(context->idle_time, SD_EVENT_OFF);
if (r < 0)
log_warning_errno(r, "Unable to disable idle timer, continuing: %m");
c = new(Connection, 1);
if (!c) {