summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-05-20 18:10:58 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-05-20 18:10:58 +0200
commit6b8664cb5b2577521e2d364153eb66649e558efb (patch)
treef7b1518347c5a0864ca05f1f8279d114e93b2f21 /src
parenta0fa2683373a3fd69d628f62240c8faca25b0361 (diff)
downloadsystemd-6b8664cb5b2577521e2d364153eb66649e558efb.tar.gz
tree-wide: fix bad errno checks
Diffstat (limited to 'src')
-rw-r--r--src/basic/fileio.c2
-rw-r--r--src/boot/bootctl.c2
-rw-r--r--src/home/homework.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/fileio.c b/src/basic/fileio.c
index 34ee939526..6b84d14624 100644
--- a/src/basic/fileio.c
+++ b/src/basic/fileio.c
@@ -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;
}
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index 222b382d57..a197668ce9 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -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);
diff --git a/src/home/homework.c b/src/home/homework.c
index 71e7cfdb49..76fd79fc2a 100644
--- a/src/home/homework.c
+++ b/src/home/homework.c
@@ -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 {