-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
canlogserver: Fix termination after signal #423
base: master
Are you sure you want to change the base?
Conversation
this commit should be "canlogserver: fix termination after signal" Because before that there was a proper exit of the application. |
With f45de1b, we've removed unsafe function exit(3) from the signal handler. But that made canlogserver's accept(3)ing process not exit; It unconditionally keeps running with EINTR. Check the variable "running" when signaled and exit with an appropriate error code. Fixes: f45de1b ("canlogserver: Follow Bash exit status when signaled") Signed-off-by: Yasushi SHOJI <[email protected]>
eafcf29
to
0d276a1
Compare
@hartkopp ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the kernel coding style.
} | ||
else if ((errno == EINTR) && !running) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
else if ((errno == EINTR) && !running) { | |
} else if ((errno == EINTR) && !running) { |
if (signal_num) { | ||
return 128 + signal_num; | ||
} | ||
else { | ||
return 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (signal_num) { | |
return 128 + signal_num; | |
} | |
else { | |
return 1; | |
} | |
if (signal_num) | |
return 128 + signal_num; | |
else | |
return 1; |
With f45de1b, we've removed unsafe function exit(3) from the signal handler. But that made canlogserver's accept(3)ing process not exit; It unconditionally keeps running with EINTR.
Check the variable "running" when signaled and exit with an appropriate error code.