From 24c3c97633f691fdf2a3467f63aedde19bf8fec1 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek" Date: Wed, 25 Apr 2012 11:22:09 +0000 Subject: Fix compilation warnings related to unchecked return values Patch by Chris Dearman R=benchan at http://breakpad.appspot.com/377001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@957 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/handler/exception_handler_unittest.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/client/linux/handler/exception_handler_unittest.cc') diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc index 84fc08ed..6fcf251b 100644 --- a/src/client/linux/handler/exception_handler_unittest.cc +++ b/src/client/linux/handler/exception_handler_unittest.cc @@ -669,7 +669,14 @@ CrashHandler(const void* crash_context, size_t crash_context_size, void* context) { const int fd = (intptr_t) context; int fds[2]; - pipe(fds); + if (pipe(fds) == -1) { + // There doesn't seem to be any way to reliably handle + // this failure without the parent process hanging + // At least make sure that this process doesn't access + // unexpected file descriptors + fds[0] = -1; + fds[1] = -1; + } struct kernel_msghdr msg = {0}; struct kernel_iovec iov; iov.iov_base = const_cast(crash_context); -- cgit v1.2.1