]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-sleep.c
tree-wide: use -EBADF for fd initialization
[thirdparty/systemd.git] / src / test / test-sleep.c
index 6bac115f717c7f0fcf9919a0bf71551e6d05e56c..abaae43e7240735267bdbfaa4e21f3588f98a9f2 100644 (file)
@@ -15,7 +15,6 @@
 #include "sleep-config.h"
 #include "strv.h"
 #include "tests.h"
-#include "util.h"
 
 TEST(parse_sleep_config) {
         _cleanup_(free_sleep_configp) SleepConfig *sleep_config = NULL;
@@ -44,7 +43,7 @@ TEST(parse_sleep_config) {
 
 static int test_fiemap_one(const char *path) {
         _cleanup_free_ struct fiemap *fiemap = NULL;
-        _cleanup_close_ int fd = -1;
+        _cleanup_close_ int fd = -EBADF;
         int r;
 
         log_info("/* %s */", __func__);
@@ -109,13 +108,13 @@ TEST(sleep) {
 
         log_info("/= high-level sleep verbs =/");
         r = can_sleep(SLEEP_SUSPEND);
-        log_info("Suspend configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r));
+        log_info("Suspend configured and possible: %s", r >= 0 ? yes_no(r) : STRERROR(r));
         r = can_sleep(SLEEP_HIBERNATE);
-        log_info("Hibernation configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r));
+        log_info("Hibernation configured and possible: %s", r >= 0 ? yes_no(r) : STRERROR(r));
         r = can_sleep(SLEEP_HYBRID_SLEEP);
-        log_info("Hybrid-sleep configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r));
+        log_info("Hybrid-sleep configured and possible: %s", r >= 0 ? yes_no(r) : STRERROR(r));
         r = can_sleep(SLEEP_SUSPEND_THEN_HIBERNATE);
-        log_info("Suspend-then-Hibernate configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r));
+        log_info("Suspend-then-Hibernate configured and possible: %s", r >= 0 ? yes_no(r) : STRERROR(r));
 }
 
 static int intro(void) {