diff options
Diffstat (limited to 'src/libelogind/sd-daemon/sd-daemon.c')
-rw-r--r-- | src/libelogind/sd-daemon/sd-daemon.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libelogind/sd-daemon/sd-daemon.c b/src/libelogind/sd-daemon/sd-daemon.c index 06d3c64ff..78274e167 100644 --- a/src/libelogind/sd-daemon/sd-daemon.c +++ b/src/libelogind/sd-daemon/sd-daemon.c @@ -38,7 +38,6 @@ #include "fs-util.h" #include "parse-util.h" #include "path-util.h" -#include "process-util.h" #include "socket-util.h" #include "strv.h" #include "util.h" @@ -163,7 +162,7 @@ _public_ int sd_is_fifo(int fd, const char *path) { if (stat(path, &st_path) < 0) { - if (errno == ENOENT || errno == ENOTDIR) + if (IN_SET(errno, ENOENT, ENOTDIR)) return 0; return -errno; @@ -193,7 +192,7 @@ _public_ int sd_is_special(int fd, const char *path) { if (stat(path, &st_path) < 0) { - if (errno == ENOENT || errno == ENOTDIR) + if (IN_SET(errno, ENOENT, ENOTDIR)) return 0; return -errno; @@ -301,8 +300,7 @@ _public_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint if (l < sizeof(sa_family_t)) return -EINVAL; - if (sockaddr.sa.sa_family != AF_INET && - sockaddr.sa.sa_family != AF_INET6) + if (!IN_SET(sockaddr.sa.sa_family, AF_INET, AF_INET6)) return 0; if (family != 0) @@ -497,7 +495,7 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char return 0; /* Must be an abstract socket, or an absolute path */ - if ((e[0] != '@' && e[0] != '/') || e[1] == 0) { + if (!IN_SET(e[0], '@', '/') || e[1] == 0) { r = -EINVAL; goto finish; } |