newlib: use SIGINT to avoid abort
This commit is contained in:
parent
e525113266
commit
a8d42cecc9
|
@ -38,8 +38,8 @@ main() {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
close(p[0]);
|
close(p[0]);
|
||||||
printf("\nPARENT: sending SIGQUIT\n\n");
|
printf("\nPARENT: sending SIGINT\n\n");
|
||||||
kill(pid,SIGQUIT);
|
kill(pid,SIGINT);
|
||||||
do {
|
do {
|
||||||
w = waitpid(pid, &status, WUNTRACED);
|
w = waitpid(pid, &status, WUNTRACED);
|
||||||
if (w == -1) {
|
if (w == -1) {
|
||||||
|
@ -52,8 +52,8 @@ main() {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
} else if (WIFSIGNALED(status)) {
|
} else if (WIFSIGNALED(status)) {
|
||||||
sig = WTERMSIG(status);
|
sig = WTERMSIG(status);
|
||||||
if(sig == SIGQUIT){
|
if(sig == SIGINT){
|
||||||
printf("killed by SIGQUIT\n");
|
printf("killed by SIGINT\n");
|
||||||
}else{
|
}else{
|
||||||
printf("killed by signal %d\n", sig);
|
printf("killed by signal %d\n", sig);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
Loading…
Reference in New Issue