summaryrefslogtreecommitdiff
path: root/audio/common/all-versions/default/service/service.cpp
diff options
context:
space:
mode:
authorMikhail Naganov <mnaganov@google.com>2021-06-17 19:55:16 +0000
committerMikhail Naganov <mnaganov@google.com>2021-06-17 19:55:16 +0000
commit9a88b5b110a30669250feb1e83bd2be532be50db (patch)
tree65c3ccab4ada1a6740fe0bf027dd633c2998986d /audio/common/all-versions/default/service/service.cpp
parent15410861bf718a638460b12c29efaeeeafa6888f (diff)
audio: Ignore SIGPIPE in the default audio HAL wrapper
It could happen that a service process receives a SIGPIPE while providing a dump due unexpected pipe closure on the other side. This should not lead to a service termination. Ignoring SIGPIPE is a normal practice for system services. Bug: 191123848 Test: adb shell kill -s 13 <pid-of-audio-hal> Change-Id: I9c1d170b76aa27203206e8fd2ce2fc3f5431baac
Diffstat (limited to 'audio/common/all-versions/default/service/service.cpp')
-rw-r--r--audio/common/all-versions/default/service/service.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/common/all-versions/default/service/service.cpp b/audio/common/all-versions/default/service/service.cpp
index bbc14adc6c..898c22db6a 100644
--- a/audio/common/all-versions/default/service/service.cpp
+++ b/audio/common/all-versions/default/service/service.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "audiohalservice"
+#include <signal.h>
#include <string>
#include <vector>
@@ -45,6 +46,8 @@ static bool registerPassthroughServiceImplementations(Iter first, Iter last) {
}
int main(int /* argc */, char* /* argv */ []) {
+ signal(SIGPIPE, SIG_IGN);
+
::android::ProcessState::initWithDriver("/dev/vndbinder");
// start a threadpool for vndbinder interactions
::android::ProcessState::self()->startThreadPool();