Fix RecvMsgWithPid on broken socket pair
commitd438013e45ce81326fd3b53a18e77ae8548b711e
authormdempsky@chromium.org <mdempsky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 16 May 2014 08:57:55 +0000 (16 08:57 +0000)
committermdempsky@chromium.org <mdempsky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 16 May 2014 08:57:55 +0000 (16 08:57 +0000)
treebdb2f68af10436847acb990c66441b3d3f082622
parentb349f9cbd6d62a5f5e8b3b7084aaf9dfc349a7e1
Fix RecvMsgWithPid on broken socket pair

This prevents RecvMsgWithPid from DCHECK failing under Debug builds
when reading EOF from a broken socket pair.  Noticed while testing
crrev.com/269543014.

Unfortunately, Linux allows sending zero length messages that the
recvmsg() API does not distinguish from reading EOF.  To be
conservative, if we didn't receive any message or control bytes, then
assume we received an EOF and tolerate not knowing the sender's PID.

BUG=357670

Review URL: https://codereview.chromium.org/276593008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270967 0039d316-1c4b-4281-b951-d872f2087c98
base/posix/unix_domain_socket_linux.cc
base/posix/unix_domain_socket_linux_unittest.cc