1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Fix: Avoid invalid locking in signal handlers.

This should also be fixed in master.

Closes: #2299
This commit is contained in:
Philipp Schafft 2016-12-07 18:38:54 +00:00
parent 1a4bb8865b
commit cc931660b9
3 changed files with 5 additions and 8 deletions

View File

@ -343,6 +343,8 @@ static void _server_proc(void)
}
connection_accept_loop();
ICECAST_LOG_INFO("Caught halt request, shutting down...");
connection_setup_sockets (NULL);
}

View File

@ -55,11 +55,7 @@ void _sig_ignore(int signo)
void _sig_hup(int signo)
{
ICECAST_LOG_INFO("Caught signal %d, scheduling config re-read...", signo);
global_lock();
global . schedule_config_reread = 1;
global_unlock();
/* some OSes require us to reattach the signal handler */
signal(SIGHUP, _sig_hup);
@ -67,8 +63,6 @@ void _sig_hup(int signo)
void _sig_die(int signo)
{
ICECAST_LOG_INFO("Caught signal %d, shutting down...", signo);
/* inform the server to start shutting down */
global.running = ICECAST_HALTING;
}

View File

@ -746,8 +746,9 @@ static void *_slave_thread(void *arg)
global_lock();
if (global . schedule_config_reread)
{
event_config_read (NULL);
global . schedule_config_reread = 0;
global.schedule_config_reread = 0;
ICECAST_LOG_INFO("Caught config reload request, re-reading config...");
event_config_read(NULL);
}
global_unlock();