From cef7c5267a3ae0618c4f7dfde61587a1f5addb6d Mon Sep 17 00:00:00 2001 From: "agl@chromium.org" Date: Tue, 10 Feb 2009 08:15:02 +0000 Subject: POSIX: fix file descriptor passing The kernel sets msghdr.msg_controllen to the length of the received control data on successful return. Thus, we need to reset this variable to the length of the buffer before each call. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9471 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/ipc_channel_posix.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/common/ipc_channel_posix.cc b/chrome/common/ipc_channel_posix.cc index fc198e6..b688c77 100644 --- a/chrome/common/ipc_channel_posix.cc +++ b/chrome/common/ipc_channel_posix.cc @@ -364,9 +364,10 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() { msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = input_cmsg_buf_; - msg.msg_controllen = sizeof(input_cmsg_buf_); for (;;) { + msg.msg_controllen = sizeof(input_cmsg_buf_); + if (bytes_read == 0) { if (pipe_ == -1) return false; -- cgit v1.1