1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 17:15:21 +02:00

Avoid signal-unsafe operations in POSIX signal handler (#16160)

This commit is contained in:
JosiahWI
2025-06-01 08:24:32 -05:00
committed by GitHub
parent 56a7f0b7cf
commit 0bb87eb1ff
11 changed files with 53 additions and 42 deletions

View File

@@ -9,6 +9,8 @@
#include "util/container.h"
#include "log.h"
#include "log_internal.h"
#include <csignal>
#include <set>
#include <sstream>
@@ -45,7 +47,7 @@ public:
void setup(
ChatInterface *iface,
bool *kill_requested,
volatile std::sig_atomic_t *kill_requested,
const std::string &nick)
{
m_nick = nick;
@@ -96,9 +98,9 @@ private:
int m_rows;
bool m_can_draw_text;
bool *m_kill_requested = nullptr;
ChatBackend m_chat_backend;
ChatInterface *m_chat_interface;
volatile std::sig_atomic_t *m_kill_requested = nullptr;
ChatBackend m_chat_backend;
ChatInterface *m_chat_interface;
TermLogOutput m_log_output;