Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a88b5b1 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

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
parent 15410861
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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();