Fix signal handler #276

Open
opened 2026-10-05 04:09:23 +02:00 by adam · 2 comments
Owner

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

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

The function "[fprintf](https://github.com/znc/znc/blob/b2dcad5fd49e6c0d604de38c311db0e08ed061a7/src/Utils.cpp#L293)" does not belong to the list of [async-signal-safe functions](https://www.securecoding.cert.org/confluence/display/cplusplus/SIG30-CPP.+Call+only+asynchronous-safe+functions+within+signal+handlers). I guess that a different program design will be needed for your function "[signalHandler](https://github.com/znc/znc/blob/b2dcad5fd49e6c0d604de38c311db0e08ed061a7/src/main.cpp#L84)". ## <bountysource-plugin> Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1331674-fix-signal-handler?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:23152432 -->
Author
Owner

Would you like to consider software design options like the following?

Would you like to consider software design options like the following? - [Self-pipe trick](http://cr.yp.to/docs/selfpipe.html) - [sigwaitinfo()](http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigwaitinfo.html) - [Signal-safe locks](http://locklessinc.com/articles/signalsafe_locks/) <!-- github-comment-id:29131296 -->
Author
Owner

You're overcomplicating things...
Removing fprintf from it is enough.

You're overcomplicating things... Removing `fprintf` from it is enough. <!-- github-comment-id:29132158 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#276