diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c index 2e22bd0bbe..de28f00c65 100644 --- a/src/shared/sleep-config.c +++ b/src/shared/sleep-config.c @@ -17,6 +17,7 @@ #include "conf-parser.h" #include "def.h" #include "env-util.h" +#include "errno-util.h" #include "fd-util.h" #include "fileio.h" #include "log.h" @@ -201,8 +202,7 @@ int find_hibernate_location(char **device, char **type, size_t *size, size_t *us if (!f) { log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, "Failed to retrieve open /proc/swaps: %m"); - assert(errno > 0); - return -errno; + return negative_errno(); } (void) fscanf(f, "%*s %*s %*s %*s %*s\n");