canfdtest: Follow Bash exit status when signaled
Bash and many other shells use 128 + signum as the exit status when a program get signal and exit. Follow the common behavior so that we know how the programs are killed. canfdtest.c was effectively raising the received signal again to run the default signal handler. This has been declined by the maintainer because it's over-engineering. This commit replaces it with the method proposed by the maintainer. Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>pull/416/head
parent
f45de1b782
commit
7e35c7e1de
|
|
@ -584,10 +584,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
close(sockfd);
|
||||
|
||||
if (exit_sig) {
|
||||
signal(exit_sig, SIG_DFL);
|
||||
kill(getpid(), exit_sig);
|
||||
}
|
||||
if (exit_sig)
|
||||
return 128 + exit_sig;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue