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

Fix signal handler #15

Closed
elfring opened this issue May 5, 2014 · 7 comments
Closed

Fix signal handler #15

elfring opened this issue May 5, 2014 · 7 comments

Comments

@elfring
Copy link

elfring commented May 5, 2014

The function "LOG_PRINT" does not belong to the list of async-signal-safe functions.
I guess that a different program design will be needed for your function "sighandler".

@buaazp
Copy link
Owner

buaazp commented May 6, 2014

OK I see. I will try another way to process logs in future.

@buaazp
Copy link
Owner

buaazp commented Jun 16, 2014

Using async-signal-safe functions in log_handler instead of log_printf0().
Changes like redis: redis/redis#213

@elfring
Copy link
Author

elfring commented Jun 16, 2014

I wonder a bit about the references to Redis in this update. I find two statements also inappropriate in your function "sighandler".

@buaazp
Copy link
Owner

buaazp commented Jun 16, 2014

Thanks very much.
@elfring Do you mean fprintf() and exit() ? I have removed them in the latest commit.
And strcat() is safe. More infomation:
http://austingroupbugs.net/view.php?id=692#c1609

buaazp added a commit that referenced this issue Jun 16, 2014
@elfring
Copy link
Author

elfring commented Jun 16, 2014

Would you like to achieve a program termination there?

@buaazp
Copy link
Owner

buaazp commented Jun 17, 2014

Yes, the signal handler here just hooks termination signals.

@elfring
Copy link
Author

elfring commented Jun 17, 2014

Thanks for your small source code improvement.

@buaazp buaazp closed this as completed Jun 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants