8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:03:03 +01:00

Fix a bug where the shutdown handler could be called again

This commit is contained in:
Alexander Zhdanov 2024-09-05 13:50:44 +03:00 committed by Alexander Peshkov
parent 9ff9cb2a5a
commit 446b436a62

View File

@ -646,7 +646,7 @@ static void signal_handler(int)
++INET_SERVER_start; ++INET_SERVER_start;
} }
static void shutdown_handler(int) static void shutdown_handler(int shutdown_signal_code)
{ {
/************************************** /**************************************
* *
@ -655,11 +655,13 @@ static void shutdown_handler(int)
************************************** **************************************
* *
* Functional description * Functional description
* Forward sigterm signal to all child processes. * Forward shutdown signal to all child processes.
* *
**************************************/ **************************************/
kill(-1 * getpid(), SIGTERM); signal(shutdown_signal_code, SIG_IGN);
kill(-1 * getpid(), shutdown_signal_code);
exit(FINI_OK); exit(FINI_OK);
} }