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

Commit c40f4e64 authored by jp abgrall's avatar jp abgrall Committed by Android Git Automerger
Browse files

am 4b2b0a74: am 74bd799e: Merge "Exit dumpstate on SIGPIPE to avoid cascading child crashes"

* commit '4b2b0a74':
  Exit dumpstate on SIGPIPE to avoid cascading child crashes
parents ad8ce823 4b2b0a74
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -315,7 +315,13 @@ static void usage() {
		);
		);
}
}


static void sigpipe_handler(int n) {
    (void)n;
    exit(EXIT_FAILURE);
}

int main(int argc, char *argv[]) {
int main(int argc, char *argv[]) {
    struct sigaction sigact;
    int do_add_date = 0;
    int do_add_date = 0;
    int do_compress = 0;
    int do_compress = 0;
    int do_vibrate = 1;
    int do_vibrate = 1;
@@ -336,7 +342,9 @@ int main(int argc, char *argv[]) {
    }
    }
    ALOGI("begin\n");
    ALOGI("begin\n");


    signal(SIGPIPE, SIG_IGN);
    memset(&sigact, 0, sizeof(sigact));
    sigact.sa_handler = sigpipe_handler;
    sigaction(SIGPIPE, &sigact, NULL);


    /* set as high priority, and protect from OOM killer */
    /* set as high priority, and protect from OOM killer */
    setpriority(PRIO_PROCESS, 0, -20);
    setpriority(PRIO_PROCESS, 0, -20);