summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorCristian Rodríguez <crrodriguez@opensuse.org>2015-02-10 12:06:24 -0300
committerLennart Poettering <lennart@poettering.net>2015-02-10 21:20:16 +0100
commitd6d810fbf8071f8510450dbacd1d083f37603656 (patch)
tree46b41b077868b01b939f37912663108a2193a694 /src/libsystemd
parent332560792c6ef0b5c3d9719801b64d0d5f374639 (diff)
tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 276591f31b..e7e3799286 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;
}