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

Commit 558e1ef0 authored by Luis Hector Chavez's avatar Luis Hector Chavez
Browse files

Let dumpstate die a normal death when receiving a singal

Having dumpstate not generate a crash report / tombstone makes
diagnosing crashes a bit harder. This change avoids calling _exit(3)
when receiving a signal, except for SIGPIPE which we just SIG_IGN.

Bug: 76120715
Test: dumpstate
Change-Id: I7bd986251f7174de77bdcfd4ff3ee26a1ef4afc7
parent f7a23bd9
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -1634,20 +1634,8 @@ static void ExitOnInvalidArgs() {
    ShowUsageAndExit();
}

static void sig_handler(int) {
    _exit(EXIT_FAILURE);
}

static void register_sig_handler() {
    struct sigaction sa;
    sigemptyset(&sa.sa_mask);
    sa.sa_flags = 0;
    sa.sa_handler = sig_handler;
    sigaction(SIGPIPE, &sa, NULL); // broken pipe
    sigaction(SIGSEGV, &sa, NULL); // segment fault
    sigaction(SIGINT, &sa, NULL); // ctrl-c
    sigaction(SIGTERM, &sa, NULL); // killed
    sigaction(SIGQUIT, &sa, NULL); // quit
    signal(SIGPIPE, SIG_IGN);
}

bool Dumpstate::FinishZipFile() {