mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Use pipe to main process instead of printing directly from the signal handler to avoid futex wait blocking
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
+10
-1
@@ -1310,7 +1310,10 @@ int main_dnsmasq (int argc, char **argv)
|
||||
|
||||
static void sig_handler(int sig)
|
||||
{
|
||||
log_debug(DEBUG_ANY, "dnsmasq received signal %d", sig);
|
||||
/**** Pi-hole modification ****/
|
||||
send_event(pipewrite, EVENT_SIGNAL, sig, NULL);
|
||||
/******************************/
|
||||
|
||||
if (pid == 0)
|
||||
{
|
||||
/* ignore anything other than TERM during startup
|
||||
@@ -1570,6 +1573,12 @@ static void async_event(int pipe, time_t now)
|
||||
my_syslog(LOG_WARNING, _("script process exited with status %d"), ev.data);
|
||||
break;
|
||||
|
||||
/**** Pi-hole modification ****/
|
||||
case EVENT_SIGNAL:
|
||||
log_debug(DEBUG_ANY, "dnsmasq received signal %d", ev.data);
|
||||
break;
|
||||
/**************************** */
|
||||
|
||||
case EVENT_EXEC_ERR:
|
||||
my_syslog(LOG_ERR, _("failed to execute %s: %s"),
|
||||
daemon->lease_change_command, strerror(ev.data));
|
||||
|
||||
@@ -200,6 +200,9 @@ struct event_desc {
|
||||
#define EVENT_SCRIPT_LOG 25
|
||||
#define EVENT_TIME 26
|
||||
|
||||
// Pi-hole
|
||||
#define EVENT_SIGNAL 255
|
||||
|
||||
/* Exit codes. */
|
||||
#define EC_GOOD 0
|
||||
#define EC_BADCONF 1
|
||||
|
||||
Reference in New Issue
Block a user