mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
reduce old_action scope to static global, rename for clarity
This commit is contained in:
parent
9726db7a41
commit
45d4d361e9
1 changed files with 5 additions and 5 deletions
|
@ -161,9 +161,9 @@ static bool WINAPI terminate_handler(DWORD t) {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
# else
|
# else
|
||||||
struct sigaction old_action;
|
static struct sigaction gs_old_sigint_action;
|
||||||
static void terminate_handler(int signum) {
|
static void sigint_handler(int signum) {
|
||||||
sigaction(SIGINT, &old_action, NULL);
|
sigaction(SIGINT, &gs_old_sigint_action, NULL);
|
||||||
flush_history();
|
flush_history();
|
||||||
kill(0, SIGINT);
|
kill(0, SIGINT);
|
||||||
}
|
}
|
||||||
|
@ -286,8 +286,8 @@ main_loop(char *script_cmds_file, char *script_cmd, bool stayInCommandLoop) {
|
||||||
# else
|
# else
|
||||||
struct sigaction action;
|
struct sigaction action;
|
||||||
memset(&action, 0, sizeof(action));
|
memset(&action, 0, sizeof(action));
|
||||||
action.sa_handler = &terminate_handler;
|
action.sa_handler = &sigint_handler;
|
||||||
sigaction(SIGINT, &action, &old_action);
|
sigaction(SIGINT, &action, &gs_old_sigint_action);
|
||||||
# endif
|
# endif
|
||||||
rl_catch_signals = 1;
|
rl_catch_signals = 1;
|
||||||
rl_set_signals();
|
rl_set_signals();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue