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

* commit '74bd799ec20d2420459fa382533b1cc39ca9a54c':
  Exit dumpstate on SIGPIPE to avoid cascading child crashes
This commit is contained in:
jp abgrall 2013-05-28 15:46:14 -07:00 committed by Android Git Automerger
commit 4b2b0a7494

View File

@ -315,7 +315,13 @@ static void usage() {
);
}
static void sigpipe_handler(int n) {
(void)n;
exit(EXIT_FAILURE);
}
int main(int argc, char *argv[]) {
struct sigaction sigact;
int do_add_date = 0;
int do_compress = 0;
int do_vibrate = 1;
@ -336,7 +342,9 @@ int main(int argc, char *argv[]) {
}
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 */
setpriority(PRIO_PROCESS, 0, -20);