commit | ab52ff60a235c20d1c4e92001de48efce1db07fa | [log] [tgz] |
---|---|---|
author | Kalesh Singh <kaleshsingh@google.com> | Tue Jul 14 21:15:04 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jul 14 21:15:04 2020 +0000 |
tree | 50b99c4ffca0c40245fbd42f45dec7391a1a7eba | |
parent | a35cbac8655be37355272b2aa2e6c080961a9dd7 [diff] | |
parent | ce3c6a66c4eb98428d3afa471de550b4181fb4e9 [diff] |
Ignore SIGPIPE when dumping stats from SystemSuspend am: ce3c6a66c4 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/hardware/interfaces/+/12150185 Change-Id: I1e48be3c2e07d4a748f3af1a549f76bc07174f48
diff --git a/suspend/1.0/default/SuspendControlService.cpp b/suspend/1.0/default/SuspendControlService.cpp index 2a4748b..671f3dd 100644 --- a/suspend/1.0/default/SuspendControlService.cpp +++ b/suspend/1.0/default/SuspendControlService.cpp
@@ -18,6 +18,7 @@ #include <android-base/logging.h> #include <android-base/stringprintf.h> +#include <signal.h> #include "SystemSuspend.h" @@ -29,6 +30,10 @@ namespace suspend { namespace V1_0 { +static void register_sig_handler() { + signal(SIGPIPE, SIG_IGN); +} + template <typename T> binder::Status retOk(const T& value, T* ret_val) { *ret_val = value; @@ -113,6 +118,8 @@ } status_t SuspendControlService::dump(int fd, const Vector<String16>& args) { + register_sig_handler(); + const auto suspendService = mSuspend.promote(); if (!suspendService) { return DEAD_OBJECT;