Commit 2825824a authored by Michael Beck's avatar Michael Beck
Browse files

wrong endless loop handling

[r21813]
parent 15adfe51
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
int test(void) {
abort();
for(;;);
}
void handler(int sig)
{
printf(sig == SIGABRT ? "ok\n" : "fail");
fflush(stdout);
exit(sig != SIGABRT);
}
int main(int argc, char *argv[]) {
alarm(1);
signal(SIGABRT, handler);
signal(SIGALRM, handler);
test();
return 1;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment