mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Update Debug.cc to use setsignal() wrapper
So as to prefer sigaction() over either sigset() or signal(), which are less favorable due to underspecification issues and some treating them as obsolete/deprecated.
This commit is contained in:
parent
07c4662dc4
commit
a4986a17cb
1 changed files with 8 additions and 4 deletions
12
src/Debug.cc
12
src/Debug.cc
|
@ -34,6 +34,10 @@
|
||||||
#include "zeek/module_util.h"
|
#include "zeek/module_util.h"
|
||||||
#include "zeek/input.h"
|
#include "zeek/input.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "zeek/setsignal.h"
|
||||||
|
}
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
bool zeek::detail::g_policy_debug = false;
|
bool zeek::detail::g_policy_debug = false;
|
||||||
|
@ -477,8 +481,8 @@ int dbg_init_debugger(const char* cmdfile)
|
||||||
init_readline();
|
init_readline();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
signal(SIGINT, &break_signal);
|
setsignal(SIGINT, break_signal);
|
||||||
signal(SIGTERM, break_signal);
|
setsignal(SIGTERM, break_signal);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -858,8 +862,8 @@ int dbg_handle_debug_input()
|
||||||
g_debugger_state.curr_frame_idx = 0;
|
g_debugger_state.curr_frame_idx = 0;
|
||||||
g_debugger_state.already_did_list = false;
|
g_debugger_state.already_did_list = false;
|
||||||
|
|
||||||
signal(SIGINT, &break_signal);
|
setsignal(SIGINT, break_signal);
|
||||||
signal(SIGTERM, &break_signal);
|
setsignal(SIGTERM, break_signal);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue