system/hardware/interfaces
Revision | c4c90ecd9ad6319d3181527d2fdc3a2f98607834 (tree) |
---|---|
Time | 2020-07-15 06:14:54 |
Author | Kalesh Singh <kaleshsingh@goog...> |
Commiter | Automerger Merge Worker |
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: Ia18f6a1b64bada13b9d1b092557f644b78ff0616
@@ -18,6 +18,7 @@ | ||
18 | 18 | |
19 | 19 | #include <android-base/logging.h> |
20 | 20 | #include <android-base/stringprintf.h> |
21 | +#include <signal.h> | |
21 | 22 | |
22 | 23 | #include "SystemSuspend.h" |
23 | 24 |
@@ -29,6 +30,10 @@ namespace system { | ||
29 | 30 | namespace suspend { |
30 | 31 | namespace V1_0 { |
31 | 32 | |
33 | +static void register_sig_handler() { | |
34 | + signal(SIGPIPE, SIG_IGN); | |
35 | +} | |
36 | + | |
32 | 37 | template <typename T> |
33 | 38 | binder::Status retOk(const T& value, T* ret_val) { |
34 | 39 | *ret_val = value; |
@@ -113,6 +118,8 @@ static std::string dumpUsage() { | ||
113 | 118 | } |
114 | 119 | |
115 | 120 | status_t SuspendControlService::dump(int fd, const Vector<String16>& args) { |
121 | + register_sig_handler(); | |
122 | + | |
116 | 123 | const auto suspendService = mSuspend.promote(); |
117 | 124 | if (!suspendService) { |
118 | 125 | return DEAD_OBJECT; |