Loading cmds/dumpstate/dumpstate.c +4 −2 Original line number Diff line number Diff line Loading @@ -378,8 +378,8 @@ static void usage() { } static void sigpipe_handler(int n) { (void)n; exit(EXIT_FAILURE); // don't complain to stderr or stdout _exit(EXIT_FAILURE); } int main(int argc, char *argv[]) { Loading @@ -404,10 +404,12 @@ int main(int argc, char *argv[]) { } ALOGI("begin\n"); 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); FILE *oom_adj = fopen("/proc/self/oom_adj", "w"); Loading cmds/dumpstate/utils.c +6 −0 Original line number Diff line number Diff line Loading @@ -313,6 +313,12 @@ int run_command(const char *title, int timeout_seconds, const char *command, ... /* make sure the child dies when dumpstate dies */ prctl(PR_SET_PDEATHSIG, SIGKILL); /* just ignore SIGPIPE, will go down with parent's */ struct sigaction sigact; memset(&sigact, 0, sizeof(sigact)); sigact.sa_handler = SIG_IGN; sigaction(SIGPIPE, &sigact, NULL); va_list ap; va_start(ap, command); if (title) printf("------ %s (%s", title, command); Loading Loading
cmds/dumpstate/dumpstate.c +4 −2 Original line number Diff line number Diff line Loading @@ -378,8 +378,8 @@ static void usage() { } static void sigpipe_handler(int n) { (void)n; exit(EXIT_FAILURE); // don't complain to stderr or stdout _exit(EXIT_FAILURE); } int main(int argc, char *argv[]) { Loading @@ -404,10 +404,12 @@ int main(int argc, char *argv[]) { } ALOGI("begin\n"); 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); FILE *oom_adj = fopen("/proc/self/oom_adj", "w"); Loading
cmds/dumpstate/utils.c +6 −0 Original line number Diff line number Diff line Loading @@ -313,6 +313,12 @@ int run_command(const char *title, int timeout_seconds, const char *command, ... /* make sure the child dies when dumpstate dies */ prctl(PR_SET_PDEATHSIG, SIGKILL); /* just ignore SIGPIPE, will go down with parent's */ struct sigaction sigact; memset(&sigact, 0, sizeof(sigact)); sigact.sa_handler = SIG_IGN; sigaction(SIGPIPE, &sigact, NULL); va_list ap; va_start(ap, command); if (title) printf("------ %s (%s", title, command); Loading