summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/automount.c3
-rw-r--r--src/core/socket.c3
-rw-r--r--src/core/timer.c4
-rw-r--r--src/import/curl-util.c6
-rw-r--r--src/journal/journald-server.c10
-rw-r--r--src/socket-proxy/socket-proxyd.c8
6 files changed, 10 insertions, 24 deletions
diff --git a/src/core/automount.c b/src/core/automount.c
index 6cb9d525c2..a7b08d60ad 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -734,9 +734,6 @@ static int automount_start_expire(Automount *a) {
static void automount_stop_expire(Automount *a) {
assert(a);
- if (!a->expire_event_source)
- return;
-
(void) sd_event_source_set_enabled(a->expire_event_source, SD_EVENT_OFF);
}
diff --git a/src/core/socket.c b/src/core/socket.c
index 41147d4bf7..8839a26d50 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1734,9 +1734,6 @@ static void socket_unwatch_fds(Socket *s) {
if (p->fd < 0)
continue;
- if (!p->event_source)
- continue;
-
r = sd_event_source_set_enabled(p->event_source, SD_EVENT_OFF);
if (r < 0)
log_unit_debug_errno(UNIT(s), r, "Failed to disable event source: %m");
diff --git a/src/core/timer.c b/src/core/timer.c
index d7ce4733c0..7cb58cc2d9 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -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");
diff --git a/src/import/curl-util.c b/src/import/curl-util.c
index 1628f833a9..4b65f4619f 100644
--- a/src/import/curl-util.c
+++ b/src/import/curl-util.c
@@ -142,10 +142,8 @@ static int curl_glue_timer_callback(CURLM *curl, long timeout_ms, void *userdata
}
if (timeout_ms < 0) {
- if (g->timer) {
- if (sd_event_source_set_enabled(g->timer, SD_EVENT_OFF) < 0)
- return -1;
- }
+ if (sd_event_source_set_enabled(g->timer, SD_EVENT_OFF) < 0)
+ return -1;
return 0;
}
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 717c8e480e..211f5c3d83 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -784,12 +784,10 @@ static void server_sync(Server *s, bool wait) {
"Failed to sync user journal, ignoring: %m");
}
- if (s->sync_event_source) {
- r = sd_event_source_set_enabled(s->sync_event_source, SD_EVENT_OFF);
- if (r < 0)
- log_ratelimit_error_errno(r, JOURNAL_LOG_RATELIMIT,
- "Failed to disable sync timer source: %m");
- }
+ r = sd_event_source_set_enabled(s->sync_event_source, SD_EVENT_OFF);
+ if (r < 0)
+ log_ratelimit_warning_errno(r, JOURNAL_LOG_RATELIMIT,
+ "Failed to disable sync timer source, ignoring: %m");
s->sync_scheduled = false;
}
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c
index dd9fa07153..7648a6ce7d 100644
--- a/src/socket-proxy/socket-proxyd.c
+++ b/src/socket-proxy/socket-proxyd.c
@@ -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) {