diff options
author | Diego Santa Cruz <Diego.SantaCruz@spinetix.com> | 2020-09-09 16:54:21 +0000 |
---|---|---|
committer | Tobias Klauser <tobias.klauser@gmail.com> | 2020-09-10 09:27:53 +0200 |
commit | a1a821814101144d242dff00922ece0462b56f72 (patch) | |
tree | 96d54b2d5ba8837caaf2da9dd577294d661a5827 | |
parent | 9709b4e2f5a32aab087c65994a600dc465310918 (diff) |
llmnrd: only async signal safe functions may be called in signal handler
Signal handlers may only call async signal safe functions and logging
is certainly not async signal safe, so move the log message to the
main loop.
While at it change "Interrupt" for "Signal" in the message which is
more appropriate.
Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
-rw-r--r-- | llmnrd.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -91,7 +91,6 @@ static void signal_handler(int sig) case SIGINT: case SIGQUIT: case SIGTERM: - log_info("Interrupt received. Stopping llmnrd.\n"); llmnrd_running = false; break; case SIGHUP: @@ -281,6 +280,8 @@ int main(int argc, char **argv) } } + log_info("Signal received. Stopping llmnrd.\n"); + ret = 0; out: if (llmnrd_sock_rtnl >= 0) |