Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yashi
Copy link
Contributor

@yashi yashi commented Apr 6, 2023

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.

@hartkopp
Copy link
Member

hartkopp commented Apr 6, 2023

this commit should be "canlogserver: fix termination after signal"

Because before that there was a proper exit of the application.
Also please add a "Fixes:" tag into the commit message.

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]>
@yashi yashi force-pushed the canlogserver-exit-when-signaled branch from eafcf29 to 0d276a1 Compare April 6, 2023 12:57
@yashi yashi changed the title canlogserver: Exit when signaled canlogserver: Fix termination after signal Apr 6, 2023
@yashi
Copy link
Contributor Author

yashi commented May 14, 2023

@hartkopp ping

Copy link
Member

@marckleinebudde marckleinebudde left a 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.

Comment on lines 308 to +309
}
else if ((errno == EINTR) && !running) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
else if ((errno == EINTR) && !running) {
} else if ((errno == EINTR) && !running) {

Comment on lines +311 to +316
if (signal_num) {
return 128 + signal_num;
}
else {
return 1;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (signal_num) {
return 128 + signal_num;
}
else {
return 1;
}
if (signal_num)
return 128 + signal_num;
else
return 1;

canlogserver.c Show resolved Hide resolved
canlogserver.c Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants