diff options
| author | 2021-04-02 22:31:29 +0000 | |
|---|---|---|
| committer | 2021-04-02 22:31:29 +0000 | |
| commit | 44f85ee1162cf3e8a2fd9630e1d0d7b135546cd0 (patch) | |
| tree | 65f44743842c6af0f61552f99fa732583e59eddb /libs/binder/RpcState.cpp | |
| parent | 542e555b492c106b1e4718b869581498b1d6dac1 (diff) | |
| parent | 876a646ea707bf090b04f370cd1444256ba08b5f (diff) | |
Merge "libbinder: RPC avoid SIGPIPE" am: 876a646ea7
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1663085
Change-Id: I42e34f1245e106f0bbe79e8c6f50245af42c5290
Diffstat (limited to 'libs/binder/RpcState.cpp')
| -rw-r--r-- | libs/binder/RpcState.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp index 64e842e927..3b3adca34f 100644 --- a/libs/binder/RpcState.cpp +++ b/libs/binder/RpcState.cpp @@ -192,7 +192,7 @@ bool RpcState::rpcSend(const base::unique_fd& fd, const char* what, const void* return false; } - ssize_t sent = TEMP_FAILURE_RETRY(send(fd.get(), data, size, 0)); + ssize_t sent = TEMP_FAILURE_RETRY(send(fd.get(), data, size, MSG_NOSIGNAL)); if (sent < 0 || sent != static_cast<ssize_t>(size)) { ALOGE("Failed to send %s (sent %zd of %zu bytes) on fd %d, error: %s", what, sent, size, @@ -212,7 +212,7 @@ bool RpcState::rpcRec(const base::unique_fd& fd, const char* what, void* data, s return false; } - ssize_t recd = TEMP_FAILURE_RETRY(recv(fd.get(), data, size, MSG_WAITALL)); + ssize_t recd = TEMP_FAILURE_RETRY(recv(fd.get(), data, size, MSG_WAITALL | MSG_NOSIGNAL)); if (recd < 0 || recd != static_cast<ssize_t>(size)) { terminate(); |