diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/hwclock.c | 2 | ||||
-rw-r--r-- | src/shared/install.c | 2 | ||||
-rw-r--r-- | src/shared/socket-util.c | 2 | ||||
-rw-r--r-- | src/shared/util.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/hwclock.c b/src/shared/hwclock.c index 488c30e93f..55b0fa8a0f 100644 --- a/src/shared/hwclock.c +++ b/src/shared/hwclock.c @@ -190,7 +190,7 @@ int hwclock_is_localtime(void) { truncate_nl(line); local = streq(line, "LOCAL"); - } else if (errno != -ENOENT) + } else if (errno != ENOENT) return -errno; return local; diff --git a/src/shared/install.c b/src/shared/install.c index 9e870392f2..b368b9f9ab 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1637,7 +1637,7 @@ UnitFileState unit_file_get_state( return state; r = unit_file_can_install(&paths, root_dir, path, true); - if (r < 0 && errno != -ENOENT) + if (r < 0 && errno != ENOENT) return r; else if (r > 0) return UNIT_FILE_DISABLED; diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c index 53457886e2..4933fe08e2 100644 --- a/src/shared/socket-util.c +++ b/src/shared/socket-util.c @@ -204,7 +204,7 @@ int socket_address_parse_netlink(SocketAddress *a, const char *s) { errno = 0; if (sscanf(s, "%ms %u", &sfamily, &group) < 1) - return errno ? -errno : -EINVAL; + return errno > 0 ? -errno : -EINVAL; family = netlink_family_from_string(sfamily); if (family < 0) diff --git a/src/shared/util.c b/src/shared/util.c index 57943b6411..5827f6c7a1 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -5259,7 +5259,7 @@ int get_home_dir(char **_h) { errno = 0; p = getpwuid(u); if (!p) - return errno ? -errno : -ESRCH; + return errno > 0 ? -errno : -ESRCH; if (!path_is_absolute(p->pw_dir)) return -EINVAL; |