X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd%2Fsd-rtnl%2Frtnl-message.c;fp=src%2Flibsystemd%2Fsd-rtnl%2Frtnl-message.c;h=e7e3799286124af22b2838002dbd98af486aec86;hb=d6d810fbf8071f8510450dbacd1d083f37603656;hp=276591f31b9e2d029985e6912a37b1445f3fcd6e;hpb=332560792c6ef0b5c3d9719801b64d0d5f374639;p=elogind.git diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index 276591f31..e7e379928 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -1431,7 +1431,7 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool assert(fd >= 0); assert(iov); - r = recvmsg(fd, &msg, MSG_TRUNC | (peek ? MSG_PEEK : 0)); + r = recvmsg(fd, &msg, MSG_TRUNC | MSG_CMSG_CLOEXEC | (peek ? MSG_PEEK : 0)); if (r < 0) { /* no data */ if (errno == ENOBUFS) @@ -1467,7 +1467,7 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool /* not from the kernel, ignore */ if (peek) { /* drop the message */ - r = recvmsg(fd, &msg, 0); + r = recvmsg(fd, &msg, MSG_CMSG_CLOEXEC); if (r < 0) return (errno == EAGAIN || errno == EINTR) ? 0 : -errno; }