diff --git a/src/core/socket.c b/src/core/socket.c index 3e569327c8..a485db67c5 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -1976,7 +1976,7 @@ static int socket_chown(Socket *s, PidRef *ret_pid) { r = socket_arm_timer(s, usec_add(now(CLOCK_MONOTONIC), s->timeout_usec)); if (r < 0) - goto fail; + return r; /* We have to resolve the user names out-of-process, hence * let's fork here. It's messy, but well, what can we do? */ @@ -2032,18 +2032,14 @@ static int socket_chown(Socket *s, PidRef *ret_pid) { r = pidref_set_pid(&pidref, pid); if (r < 0) - goto fail; + return r; r = unit_watch_pid(UNIT(s), pidref.pid, /* exclusive= */ true); if (r < 0) - goto fail; + return r; *ret_pid = TAKE_PIDREF(pidref); return 0; - -fail: - s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source); - return r; } static void socket_enter_dead(Socket *s, SocketResult f) { diff --git a/src/core/swap.c b/src/core/swap.c index 386725c847..c467008fb2 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -677,11 +677,11 @@ static int swap_spawn(Swap *s, ExecCommand *c, PidRef *ret_pid) { r = swap_arm_timer(s, usec_add(now(CLOCK_MONOTONIC), s->timeout_usec)); if (r < 0) - goto fail; + return r; r = unit_set_exec_params(UNIT(s), &exec_params); if (r < 0) - goto fail; + return r; r = exec_spawn(UNIT(s), c, @@ -691,22 +691,18 @@ static int swap_spawn(Swap *s, ExecCommand *c, PidRef *ret_pid) { &s->cgroup_context, &pid); if (r < 0) - goto fail; + return r; r = pidref_set_pid(&pidref, pid); if (r < 0) - goto fail; + return r; r = unit_watch_pid(UNIT(s), pidref.pid, /* exclusive= */ true); if (r < 0) - goto fail; + return r; *ret_pid = TAKE_PIDREF(pidref); return 0; - -fail: - s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source); - return r; } static void swap_enter_dead(Swap *s, SwapResult f) {