HomeClusterLabs Projects
Diffusion Booth e932fb315898

main: Use only signal-safe functions

Description

main: Use only signal-safe functions

Previously signal unsafe functions were used (for example qb_log, exit,
...) which may result in deadlock or incorrect behavior.

Patch tries to solve signal handling in main.c by using using method of
setting variable (signal safe) and handling variable outside of signal
handler in loop function after the poll function returns.

Maximum poll timeout is set to minimum of POLL_TIMEOUT and user
configured timeout, so it is always at maximum POLL_TIMEOUT = 100 ms so
signal handling seems to be responsive enough. Other method may be to
have information fd, but such solution seems to be a bit overkill.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>

Details

Provenance
jfriesseAuthored on May 9 2022, 12:13 PM
Parents
rB95d854b32a7c: Merge pull request #106 from ddstreet/dont_mlockall_if_setrlimit_fails
Branches
Unknown
Tags
Unknown

Event Timeline