]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sleep: use negative_errno() where appropriate
authorLennart Poettering <lennart@poettering.net>
Tue, 26 Mar 2019 08:57:53 +0000 (09:57 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 Mar 2019 10:17:23 +0000 (11:17 +0100)
src/shared/sleep-config.c

index 2e22bd0bbe2157719dba6484e3218b261c29be10..de28f00c656f2dbf84c23fbf4dff9348d6603531 100644 (file)
@@ -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");