mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibTest: Do not cleanly exit when abort() is called
Instead, do the cleanup, remove the signal handler, and abort() again.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
578bf6c45e
commit
13c1514889
@@ -32,7 +32,17 @@ static StringView g_program_name { "test-js"sv };
|
||||
static void handle_sigabrt(int)
|
||||
{
|
||||
dbgln("{}: SIGABRT received, cleaning up.", g_program_name);
|
||||
cleanup_and_exit();
|
||||
cleanup();
|
||||
struct sigaction act;
|
||||
memset(&act, 0, sizeof(act));
|
||||
act.sa_flags = SA_NOCLDWAIT;
|
||||
act.sa_handler = SIG_DFL;
|
||||
int rc = sigaction(SIGABRT, &act, nullptr);
|
||||
if (rc < 0) {
|
||||
perror("sigaction");
|
||||
exit(1);
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
||||
Reference in New Issue
Block a user