diff options
author | Nikias Bassen | 2019-10-11 23:16:05 +0200 |
---|---|---|
committer | Nikias Bassen | 2019-10-11 23:16:05 +0200 |
commit | bd85a1bd5a8dd8cce74a9235011f866402a23c59 (patch) | |
tree | 7b46fcd11448c4b118cc6fcf7ddc0379e9c34b60 /src/idevicerestore.c | |
parent | 767fcceaeb456f5e281a6bd1b3f51713e4989293 (diff) | |
download | idevicerestore-bd85a1bd5a8dd8cce74a9235011f866402a23c59.tar.gz idevicerestore-bd85a1bd5a8dd8cce74a9235011f866402a23c59.tar.bz2 |
win32: Use signal on win32 but make sure user input can be cancelled with ctrl+c
also added ESC key as a fallback cancel method.
Diffstat (limited to 'src/idevicerestore.c')
-rw-r--r-- | src/idevicerestore.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c index f96fc61..7c02eda 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -1499,12 +1499,16 @@ int main(int argc, char* argv[]) { idevicerestore_client = client; +#ifdef WIN32 + signal(SIGINT, handle_signal); + signal(SIGTERM, handle_signal); + signal(SIGABRT, handle_signal); +#else struct sigaction sa; memset(&sa, 0, sizeof(struct sigaction)); sa.sa_handler = handle_signal; sigaction(SIGINT, &sa, NULL); sigaction(SIGTERM, &sa, NULL); -#ifndef WIN32 sigaction(SIGQUIT, &sa, NULL); sa.sa_handler = SIG_IGN; sigaction(SIGPIPE, &sa, NULL); |