linux: make GetHandlerSocket() params optional

It turns out it's frequently convenient to only grab one of these at a time.

Change-Id: Ie4a05583a5c875163154efc485d57a014101cc16
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1838011
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Joshua Peraza 2019-10-03 10:25:00 -07:00
parent 676a190308
commit eb0c4726f1
2 changed files with 8 additions and 4 deletions

View File

@ -124,8 +124,8 @@ class CrashpadClient {
//! `StartHandler()` must have successfully been called before calling this
//! method.
//!
//! \param[out] sock The socket connected to the handler.
//! \param[out] pid The handler's process ID.
//! \param[out] sock The socket connected to the handler, if not `nullptr`.
//! \param[out] pid The handler's process ID, if not `nullptr`.
//! \return `true` on success. Otherwise `false` with a message logged.
static bool GetHandlerSocket(int* sock, pid_t* pid);

View File

@ -295,8 +295,12 @@ class RequestCrashDumpHandler : public SignalHandler {
if (!sock_to_handler_.is_valid()) {
return false;
}
*sock = sock_to_handler_.get();
*pid = handler_pid_;
if (sock) {
*sock = sock_to_handler_.get();
}
if (pid) {
*pid = handler_pid_;
}
return true;
}