From 438898bd43de579b4b6428cc7ab01355913e2798 Mon Sep 17 00:00:00 2001 From: jsteube Date: Sat, 17 Sep 2016 20:18:38 +0200 Subject: [PATCH] Fix https://github.com/hashcat/hashcat/issues/504 --- src/hashcat.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index ff08d3d8d..b6cd254cc 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -5413,13 +5413,15 @@ int main (int argc, char **argv) if (quiet == 0) log_info_nn ("Started: %s", ctime (&proc_start)); if (quiet == 0) log_info_nn ("Stopped: %s", ctime (&proc_stop)); + u32 rc_final = -1; + + if (opencl_ctx->devices_status == STATUS_ABORTED) rc_final = 2; + if (opencl_ctx->devices_status == STATUS_QUIT) rc_final = 2; + if (opencl_ctx->devices_status == STATUS_STOP_AT_CHECKPOINT) rc_final = 2; + if (opencl_ctx->devices_status == STATUS_EXHAUSTED) rc_final = 1; + if (opencl_ctx->devices_status == STATUS_CRACKED) rc_final = 0; + opencl_ctx_destroy (opencl_ctx); - if (opencl_ctx->devices_status == STATUS_ABORTED) return 2; - if (opencl_ctx->devices_status == STATUS_QUIT) return 2; - if (opencl_ctx->devices_status == STATUS_STOP_AT_CHECKPOINT) return 2; - if (opencl_ctx->devices_status == STATUS_EXHAUSTED) return 1; - if (opencl_ctx->devices_status == STATUS_CRACKED) return 0; - - return -1; + return rc_final; }