From de5d0349c6f30ef53786a44ba55d90a8e8e4237d Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 28 Sep 2016 22:38:09 +0200 Subject: [PATCH] Fixes https://github.com/hashcat/hashcat/issues/517 --- include/types.h | 4 ++-- src/hashcat.c | 8 ++++---- src/monitor.c | 2 +- src/outfile_check.c | 2 +- src/terminal.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/types.h b/include/types.h index 636fb75e7..176d0d44e 100644 --- a/include/types.h +++ b/include/types.h @@ -1247,8 +1247,8 @@ typedef struct * threads */ - u32 shutdown_inner; - u32 shutdown_outer; + bool shutdown_inner; + bool shutdown_outer; /** * crack-per-time diff --git a/src/hashcat.c b/src/hashcat.c index 0b3b0f3c7..7bf8c68a5 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1763,7 +1763,7 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_ hc_thread_t *inner_threads = (hc_thread_t *) mycalloc (10, sizeof (hc_thread_t)); - data.shutdown_inner = 0; + data.shutdown_inner = false; /** * Outfile remove @@ -1882,7 +1882,7 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_ // wait for inner threads - data.shutdown_inner = 1; + data.shutdown_inner = true; for (uint thread_idx = 0; thread_idx < inner_threads_cnt; thread_idx++) { @@ -2240,7 +2240,7 @@ int main (int argc, char **argv) hc_thread_t *outer_threads = (hc_thread_t *) mycalloc (10, sizeof (hc_thread_t)); - data.shutdown_outer = 0; + data.shutdown_outer = false; if (user_options->keyspace == false && user_options->benchmark == false && user_options->stdout_flag == false) { @@ -2289,7 +2289,7 @@ int main (int argc, char **argv) // wait for outer threads - data.shutdown_outer = 1; + data.shutdown_outer = true; for (uint thread_idx = 0; thread_idx < outer_threads_cnt; thread_idx++) { diff --git a/src/monitor.c b/src/monitor.c index ecc24a335..e0bf28a85 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -110,7 +110,7 @@ void *thread_monitor (void *p) u32 remove_left = user_options->remove_timer; u32 status_left = user_options->status_timer; - while (data.shutdown_inner == 0) + while (data.shutdown_inner == false) { hc_sleep (sleep_time); diff --git a/src/outfile_check.c b/src/outfile_check.c index 3baee7e71..12d40e6fd 100644 --- a/src/outfile_check.c +++ b/src/outfile_check.c @@ -74,7 +74,7 @@ void *thread_outfile_remove (void *p) uint check_left = outfile_check_timer; // or 1 if we want to check it at startup - while (opencl_ctx->run_main_level2 == true) + while (data.shutdown_inner == false) { hc_sleep (1); diff --git a/src/terminal.c b/src/terminal.c index a920820b8..7f25fe01f 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -77,7 +77,7 @@ void *thread_keypress (void *p) tty_break (); - while (data.shutdown_outer == 0) + while (data.shutdown_outer == false) { int ch = tty_getchar ();