Merge "binder_rpc_fuzzer: avoid SIGPIPE"
diff --git a/libs/binder/tests/rpc_fuzzer/main.cpp b/libs/binder/tests/rpc_fuzzer/main.cpp
index 072f8dd..9fc496f 100644
--- a/libs/binder/tests/rpc_fuzzer/main.cpp
+++ b/libs/binder/tests/rpc_fuzzer/main.cpp
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include <android-base/file.h>
 #include <android-base/logging.h>
 #include <android-base/unique_fd.h>
 #include <binder/Binder.h>
@@ -90,8 +89,10 @@
             if (provider.ConsumeBool()) {
                 std::vector<uint8_t> writeData = provider.ConsumeBytes<uint8_t>(
                         provider.ConsumeIntegralInRange<size_t>(0, provider.remaining_bytes()));
-                CHECK(base::WriteFully(connections.at(idx).get(), writeData.data(),
-                                       writeData.size()));
+                ssize_t size = TEMP_FAILURE_RETRY(send(connections.at(idx).get(), writeData.data(),
+                                                       writeData.size(), MSG_NOSIGNAL));
+                CHECK(errno == EPIPE || size == writeData.size())
+                        << size << " " << writeData.size() << " " << strerror(errno);
             } else {
                 connections.erase(connections.begin() + idx); // hang up
             }