mirror of
https://github.com/monero-project/monero.git
synced 2025-08-08 22:22:33 -04:00
handle ^D and ^C while password prompting
This commit is contained in:
parent
ed67e5c001
commit
a4b50a6f51
4 changed files with 24 additions and 6 deletions
|
@ -153,8 +153,12 @@ namespace tools
|
|||
}
|
||||
return r;
|
||||
#else
|
||||
static struct sigaction sa;
|
||||
memset(&sa, 0, sizeof(struct sigaction));
|
||||
sa.sa_handler = posix_handler;
|
||||
sa.sa_flags = 0;
|
||||
/* Only blocks SIGINT, SIGTERM and SIGPIPE */
|
||||
signal(SIGINT, posix_handler);
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
signal(SIGTERM, posix_handler);
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
m_handler = t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue