diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-28 00:04:47 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-28 00:04:47 +0100 |
commit | 976dec6e7b2d193533191be2969dd4eee95fc6bb (patch) | |
tree | 966787f3d5a250343c8be936e1d5a43d97523ee9 /src/core/swap.c | |
parent | 9993ef2e9817b35b1d467707bef12b2a140b62dc (diff) |
swap: properly specify errno when logging
Diffstat (limited to 'src/core/swap.c')
-rw-r--r-- | src/core/swap.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/core/swap.c b/src/core/swap.c index b2ebed4b72..cc03b14e76 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -637,7 +637,6 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) { fail: s->timer_event_source = sd_event_source_unref(s->timer_event_source); - return r; } @@ -699,9 +698,7 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) { return; fail: - log_unit_warning(UNIT(s)->id, - "%s failed to kill processes: %s", UNIT(s)->id, strerror(-r)); - + log_unit_warning_errno(UNIT(s)->id, r, "%s failed to kill processes: %m", UNIT(s)->id); swap_enter_dead(s, SWAP_FAILURE_RESOURCES); } @@ -764,9 +761,7 @@ static void swap_enter_activating(Swap *s) { return; fail: - log_unit_warning(UNIT(s)->id, - "%s failed to run 'swapon' task: %s", - UNIT(s)->id, strerror(-r)); + log_unit_warning_errno(UNIT(s)->id, r, "%s failed to run 'swapon' task: %m", UNIT(s)->id); swap_enter_dead(s, SWAP_FAILURE_RESOURCES); } @@ -796,9 +791,7 @@ static void swap_enter_deactivating(Swap *s) { return; fail: - log_unit_warning(UNIT(s)->id, - "%s failed to run 'swapoff' task: %s", - UNIT(s)->id, strerror(-r)); + log_unit_warning_errno(UNIT(s)->id, r, "%s failed to run 'swapoff' task: %m", UNIT(s)->id); swap_enter_active(s, SWAP_FAILURE_RESOURCES); } |