Add missing TEMP_FAILURE_RETRYs to the JDWP transports.
Bug: 8620431
Change-Id: Id412c415c8a206a559928a8db90cf2dc01c9b7a2
diff --git a/src/jdwp/jdwp_adb.cc b/src/jdwp/jdwp_adb.cc
index 8734077..788b25a 100644
--- a/src/jdwp/jdwp_adb.cc
+++ b/src/jdwp/jdwp_adb.cc
@@ -332,7 +332,7 @@
if (netState->wakeFds[1] >= 0) {
VLOG(jdwp) << "+++ writing to wakePipe";
- write(netState->wakeFds[1], "", 1);
+ TEMP_FAILURE_RETRY(write(netState->wakeFds[1], "", 1));
}
}
@@ -520,7 +520,7 @@
}
errno = 0;
- cc = write(netState->clientSock, netState->inputBuffer, kMagicHandshakeLen);
+ cc = TEMP_FAILURE_RETRY(write(netState->clientSock, netState->inputBuffer, kMagicHandshakeLen));
if (cc != kMagicHandshakeLen) {
PLOG(ERROR) << "Failed writing handshake bytes (" << cc << " of " << kMagicHandshakeLen << ")";
goto fail;
diff --git a/src/jdwp/jdwp_main.cc b/src/jdwp/jdwp_main.cc
index 1f121f8..6fca7a5 100644
--- a/src/jdwp/jdwp_main.cc
+++ b/src/jdwp/jdwp_main.cc
@@ -58,7 +58,7 @@
*/
ssize_t JdwpNetStateBase::WritePacket(ExpandBuf* pReply) {
MutexLock mu(Thread::Current(), socket_lock_);
- return write(clientSock, expandBufGetBuffer(pReply), expandBufGetLength(pReply));
+ return TEMP_FAILURE_RETRY(write(clientSock, expandBufGetBuffer(pReply), expandBufGetLength(pReply)));
}
/*
@@ -66,7 +66,7 @@
*/
ssize_t JdwpNetStateBase::WriteBufferedPacket(const iovec* iov, int iov_count) {
MutexLock mu(Thread::Current(), socket_lock_);
- return writev(clientSock, iov, iov_count);
+ return TEMP_FAILURE_RETRY(writev(clientSock, iov, iov_count));
}
bool JdwpState::IsConnected() {
diff --git a/src/jdwp/jdwp_socket.cc b/src/jdwp/jdwp_socket.cc
index 43906ef..13e150a 100644
--- a/src/jdwp/jdwp_socket.cc
+++ b/src/jdwp/jdwp_socket.cc
@@ -207,7 +207,7 @@
/* if we might be sitting in select, kick us loose */
if (netState->wakePipe[1] >= 0) {
VLOG(jdwp) << "+++ writing to wakePipe";
- (void) write(netState->wakePipe[1], "", 1);
+ TEMP_FAILURE_RETRY(write(netState->wakePipe[1], "", 1));
}
}
@@ -581,7 +581,7 @@
}
errno = 0;
- cc = write(netState->clientSock, netState->inputBuffer, kMagicHandshakeLen);
+ cc = TEMP_FAILURE_RETRY(write(netState->clientSock, netState->inputBuffer, kMagicHandshakeLen));
if (cc != kMagicHandshakeLen) {
PLOG(ERROR) << "Failed writing handshake bytes (" << cc << " of " << kMagicHandshakeLen << ")";
goto fail;