tree-wide: fix bad errno checks
This commit is contained in:
parent
a0fa268337
commit
6b8664cb5b
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue