diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-03 23:56:17 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-05 02:43:56 +0900 |
commit | 4bbccb02eaee35e20d3031e7ba4b3d08631ce934 (patch) | |
tree | 27fed6568b9faa5a2586c5929159b79a4002c294 /src/test/test-sleep.c | |
parent | 7fa6223f67662e8d5ee26092240b4e1d091a69f5 (diff) | |
download | systemd-4bbccb02eaee35e20d3031e7ba4b3d08631ce934.tar.gz |
tree-wide: introduce strerror_safe()
Diffstat (limited to 'src/test/test-sleep.c')
-rw-r--r-- | src/test/test-sleep.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/test-sleep.c b/src/test/test-sleep.c index 2a23bf2384..014b1aa7a2 100644 --- a/src/test/test-sleep.c +++ b/src/test/test-sleep.c @@ -7,6 +7,7 @@ #include <sys/types.h> #include <unistd.h> +#include "errno-util.h" #include "fd-util.h" #include "log.h" #include "memory-util.h" @@ -95,13 +96,13 @@ static void test_sleep(void) { log_info("/= running system =/"); r = can_sleep("suspend"); - log_info("Suspend configured and possible: %s", r >= 0 ? yes_no(r) : strerror(-r)); + log_info("Suspend configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r)); r = can_sleep("hibernate"); - log_info("Hibernation configured and possible: %s", r >= 0 ? yes_no(r) : strerror(-r)); + log_info("Hibernation configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r)); r = can_sleep("hybrid-sleep"); - log_info("Hybrid-sleep configured and possible: %s", r >= 0 ? yes_no(r) : strerror(-r)); + log_info("Hybrid-sleep configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r)); r = can_sleep("suspend-then-hibernate"); - log_info("Suspend-then-Hibernate configured and possible: %s", r >= 0 ? yes_no(r) : strerror(-r)); + log_info("Suspend-then-Hibernate configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r)); } int main(int argc, char* argv[]) { |