Rizin
unix-like reverse engineering framework and cli tools
|
Handling signals to abort operation. More...
Go to the source code of this file.
Functions | |
void | signals_init (void) |
void | signals_block (void) |
void | signals_unblock (void) |
Unblock the signals blocked by signals_block(). More... | |
void | signals_exit (void) |
Variables | |
volatile sig_atomic_t | user_abort |
Handling signals to abort operation.
Definition in file signals.h.
void signals_block | ( | void | ) |
Block the signals which don't have SA_RESTART and which would just set user_abort to true. This is handy when we don't want to handle EINTR and don't want SA_RESTART either.
Definition at line 120 of file signals.c.
References hooked_signals, mythread_sigmask(), NULL, signals_are_initialized, and signals_block_count.
Referenced by io_close(), io_open_dest(), io_open_src(), io_open_src_real(), message_progress_update(), print_filename(), progress_flush(), and vmessage().
void signals_exit | ( | void | ) |
If user has sent us a signal earlier to terminate the process, re-raise that signal to actually terminate the process.
Definition at line 153 of file signals.c.
References E_ERROR, exit_signal, int, NULL, and set_exit_status().
Referenced by main().
void signals_init | ( | void | ) |
Initialize the signal handler, which will set user_abort to true when user e.g. presses C-c.
Definition at line 54 of file signals.c.
References ARRAY_SIZE, hooked_signals, i, message_progress_sigs, message_signal_handler(), NULL, SIGHUP, signal_handler(), and signals_are_initialized.
Referenced by main().
void signals_unblock | ( | void | ) |
Unblock the signals blocked by signals_block().
Definition at line 135 of file signals.c.
References assert(), hooked_signals, mythread_sigmask(), NULL, signals_are_initialized, and signals_block_count.
Referenced by io_close(), io_open_dest(), io_open_src(), io_open_src_real(), message_progress_update(), print_filename(), progress_flush(), and vmessage().
|
extern |
If this is true, we will clean up the possibly incomplete output file, return to main() as soon as practical. That is, the code needs to poll this variable in various places.
Definition at line 16 of file signals.c.
Referenced by coder_normal(), coder_passthru(), coder_run(), io_read(), io_wait(), io_write_buf(), main(), read_name(), and signal_handler().