From: Yu Watanabe Date: Thu, 25 Oct 2018 08:39:53 +0000 (+0900) Subject: udev: handle sd_is_socket() failure X-Git-Tag: v240~346^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c52cff074831c6ca76f20f9c972283c78d8843be;p=thirdparty%2Fsystemd.git udev: handle sd_is_socket() failure --- diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 1a643d53090..cc3fdd85931 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;