1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

Have sh print out which signal terminated a child process.

This commit is contained in:
Andreas Kling 2018-11-01 01:11:00 +01:00
parent a685809e75
commit cddd2f37e9

View file

@ -148,7 +148,11 @@ static int runcmd(char* cmd)
if (WIFEXITED(wstatus)) {
//printf("Exited normally with status %d\n", WEXITSTATUS(wstatus));
} else {
printf("Exited abnormally\n");
if (WIFSIGNALED(wstatus)) {
printf("Terminated by signal %d\n", WTERMSIG(wstatus));
} else {
printf("Exited abnormally\n");
}
}
return retval;
}