]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: fix bad errno checks 15868/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 20 May 2020 16:10:58 +0000 (18:10 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 20 May 2020 16:10:58 +0000 (18:10 +0200)
src/basic/fileio.c
src/boot/bootctl.c
src/home/homework.c

index 34ee939526f9b43b8ca8d29c1d277d56d903601a..6b84d1462438033900801bc97c16c01900fb2049 100644 (file)
@@ -419,7 +419,7 @@ int read_full_virtual_file(const char *filename, char **ret_contents, size_t *re
                                 break;
                         }
 
-                        if (errno != -EINTR)
+                        if (errno != EINTR)
                                 return -errno;
                 }
 
index 222b382d5729f16a8d67cf44ad9cfa4f37870054..a197668ce96e287998d31a6b2131ec4a9ae43612 100644 (file)
@@ -517,7 +517,7 @@ static int copy_file_with_version_check(const char *from, const char *to, bool f
         if (!force) {
                 fd_to = open(to, O_RDONLY|O_CLOEXEC|O_NOCTTY);
                 if (fd_to < 0) {
-                        if (errno != -ENOENT)
+                        if (errno != ENOENT)
                                 return log_error_errno(errno, "Failed to open \"%s\" for reading: %m", to);
                 } else {
                         r = version_check(fd_from, from, fd_to, to);
index 71e7cfdb499aaa0585e0bda939a7ef4e2d3dd9e9..76fd79fc2a02ded993f478f6ef863da59bbf2e9d 100644 (file)
@@ -1051,7 +1051,7 @@ static int home_remove(UserRecord *h) {
                 assert(ip);
 
                 if (stat(ip, &st) < 0) {
-                        if (errno != -ENOENT)
+                        if (errno != ENOENT)
                                 return log_error_errno(errno, "Failed to stat() %s: %m", ip);
 
                 } else {