gamelinux / passivedns

A network sniffer that logs all DNS server replies for use in a passive DNS setup
http://gamelinux.org/
1.67k stars 374 forks source link

Declare signal_reopen_log_files as a sig_atomic_t #126

Closed Keisial closed 2 years ago

Keisial commented 2 years ago

Strictly aligning to POSIX, signal_reopen_log_files must be a volatile sig_atomic_t.

«the behavior is undefined if the signal handler refers to any object other than errno with static storage duration other than by assigning a value to an object declared as volatile sig_atomic_t, or [calls a non-async-signal-safe function]» https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03_03