mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Avoid calling DBG_LOG during signal handling
This commit is contained in:
parent
d06387d4d3
commit
f50777cdab
1 changed files with 7 additions and 1 deletions
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#define DEFAULT_PREFIX "pcap"
|
#define DEFAULT_PREFIX "pcap"
|
||||||
|
|
||||||
|
extern int signal_val;
|
||||||
|
|
||||||
namespace zeek::iosource
|
namespace zeek::iosource
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -45,7 +47,11 @@ void Manager::WakeupHandler::Process()
|
||||||
|
|
||||||
void Manager::WakeupHandler::Ping(std::string_view where)
|
void Manager::WakeupHandler::Ping(std::string_view where)
|
||||||
{
|
{
|
||||||
|
// Calling DBG_LOG calls fprintf, which isn't safe to call in a signal
|
||||||
|
// handler.
|
||||||
|
if ( signal_val != 0 )
|
||||||
DBG_LOG(DBG_MAINLOOP, "Pinging WakeupHandler from %s", where.data());
|
DBG_LOG(DBG_MAINLOOP, "Pinging WakeupHandler from %s", where.data());
|
||||||
|
|
||||||
flare.Fire(true);
|
flare.Fire(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue