Merge "LocalSocketImpl.cpp: Set O_CLOEXEC on received FDs" am: 9156ccdbb4

am: 4400fb5bed

Change-Id: I2d0f491b2f5f814aa92749a2f5d1130393cd1a83
This commit is contained in:
Nick Kralevich
2017-01-01 22:51:23 +00:00
committed by android-build-merger

View File

@@ -202,9 +202,7 @@ static ssize_t socket_read_all(JNIEnv *env, jobject thisJ, int fd,
msg.msg_control = cmsgbuf;
msg.msg_controllen = sizeof(cmsgbuf);
do {
ret = recvmsg(fd, &msg, MSG_NOSIGNAL);
} while (ret < 0 && errno == EINTR);
ret = TEMP_FAILURE_RETRY(recvmsg(fd, &msg, MSG_NOSIGNAL | MSG_CMSG_CLOEXEC));
if (ret < 0 && errno == EPIPE) {
// Treat this as an end of stream