From: Lennart Poettering Date: Tue, 26 Mar 2019 08:57:53 +0000 (+0100) Subject: sleep: use negative_errno() where appropriate X-Git-Tag: v242-rc1~60^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=427646ea9d1baf623e5b2fa1f946a6e3f8155784;p=thirdparty%2Fsystemd.git sleep: use negative_errno() where appropriate --- diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c index 2e22bd0bbe2..de28f00c656 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");