From df09b1ac29a291b8b45d6bc503268e01006b265f Mon Sep 17 00:00:00 2001 From: "ted.mielczarek@gmail.com" Date: Thu, 9 Oct 2014 19:34:31 +0000 Subject: Linux multiprocess crash reporter: use pipe instead of socketpair in the client A=Jed Davis R=ted at https://breakpad.appspot.com/1724002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1390 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/crash_generation/crash_generation_client.cc | 2 +- src/client/linux/crash_generation/crash_generation_server.cc | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'src/client/linux') diff --git a/src/client/linux/crash_generation/crash_generation_client.cc b/src/client/linux/crash_generation/crash_generation_client.cc index 2522c955..d8bfbbad 100644 --- a/src/client/linux/crash_generation/crash_generation_client.cc +++ b/src/client/linux/crash_generation/crash_generation_client.cc @@ -50,7 +50,7 @@ class CrashGenerationClientImpl : public CrashGenerationClient { virtual bool RequestDump(const void* blob, size_t blob_size) { int fds[2]; - if (sys_socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) + if (sys_pipe(fds) < 0) return false; static const unsigned kControlMsgSize = CMSG_SPACE(sizeof(int)); diff --git a/src/client/linux/crash_generation/crash_generation_server.cc b/src/client/linux/crash_generation/crash_generation_server.cc index 1abf826c..860e8bc9 100644 --- a/src/client/linux/crash_generation/crash_generation_server.cc +++ b/src/client/linux/crash_generation/crash_generation_server.cc @@ -275,14 +275,7 @@ CrashGenerationServer::ClientEvent(short revents) } // Send the done signal to the process: it can exit now. - memset(&msg, 0, sizeof(msg)); - struct iovec done_iov; - done_iov.iov_base = const_cast("\x42"); - done_iov.iov_len = 1; - msg.msg_iov = &done_iov; - msg.msg_iovlen = 1; - - HANDLE_EINTR(sendmsg(signal_fd, &msg, MSG_DONTWAIT | MSG_NOSIGNAL)); + // (Closing this will make the child's sys_read unblock and return 0.) close(signal_fd); return true; -- cgit v1.2.1