From c52cff074831c6ca76f20f9c972283c78d8843be Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 25 Oct 2018 17:39:53 +0900 Subject: [PATCH] udev: handle sd_is_socket() failure --- src/udev/udevd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 1a643d5309..cc3fdd8593 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1368,14 +1368,14 @@ static int listen_fds(int *rctrl, int *rnetlink) { return n; for (fd = SD_LISTEN_FDS_START; fd < n + SD_LISTEN_FDS_START; fd++) { - if (sd_is_socket(fd, AF_LOCAL, SOCK_SEQPACKET, -1)) { + if (sd_is_socket(fd, AF_LOCAL, SOCK_SEQPACKET, -1) > 0) { if (ctrl_fd >= 0) return -EINVAL; ctrl_fd = fd; continue; } - if (sd_is_socket(fd, AF_NETLINK, SOCK_RAW, -1)) { + if (sd_is_socket(fd, AF_NETLINK, SOCK_RAW, -1) > 0) { if (netlink_fd >= 0) return -EINVAL; netlink_fd = fd;