mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 16:18:09 +00:00
remove hc_sleep and _msec.
MinGW defines sleep and usleep so just use those directly.
This commit is contained in:
parent
12c53352cd
commit
ec55209254
@ -33,9 +33,6 @@ void naive_escape (char *s, size_t s_max, const char key_char, const char escape
|
|||||||
|
|
||||||
void hc_asprintf (char **strp, const char *fmt, ...);
|
void hc_asprintf (char **strp, const char *fmt, ...);
|
||||||
|
|
||||||
void hc_sleep_msec (const u32 msec);
|
|
||||||
void hc_sleep (const u32 sec);
|
|
||||||
|
|
||||||
void setup_environment_variables (void);
|
void setup_environment_variables (void);
|
||||||
void setup_umask (void);
|
void setup_umask (void);
|
||||||
void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed);
|
void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed);
|
||||||
|
@ -129,7 +129,7 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
while (status_ctx->shutdown_inner == false)
|
while (status_ctx->shutdown_inner == false)
|
||||||
{
|
{
|
||||||
hc_sleep (sleep_time);
|
sleep (sleep_time);
|
||||||
|
|
||||||
if (status_ctx->devices_status == STATUS_INIT) continue;
|
if (status_ctx->devices_status == STATUS_INIT) continue;
|
||||||
|
|
||||||
|
@ -1952,7 +1952,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
|||||||
|
|
||||||
for (u32 salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++)
|
for (u32 salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++)
|
||||||
{
|
{
|
||||||
while (status_ctx->devices_status == STATUS_PAUSED) hc_sleep (1);
|
while (status_ctx->devices_status == STATUS_PAUSED) sleep (1);
|
||||||
|
|
||||||
salt_t *salt_buf = &hashes->salts_buf[salt_pos];
|
salt_t *salt_buf = &hashes->salts_buf[salt_pos];
|
||||||
|
|
||||||
@ -1983,7 +1983,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
|
|||||||
|
|
||||||
for (u64 innerloop_pos = 0; innerloop_pos < innerloop_cnt; innerloop_pos += innerloop_step)
|
for (u64 innerloop_pos = 0; innerloop_pos < innerloop_cnt; innerloop_pos += innerloop_step)
|
||||||
{
|
{
|
||||||
while (status_ctx->devices_status == STATUS_PAUSED) hc_sleep (1);
|
while (status_ctx->devices_status == STATUS_PAUSED) sleep (1);
|
||||||
|
|
||||||
u32 fast_iteration = 0;
|
u32 fast_iteration = 0;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ static int outfile_remove (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
while (status_ctx->shutdown_inner == false)
|
while (status_ctx->shutdown_inner == false)
|
||||||
{
|
{
|
||||||
hc_sleep (1);
|
sleep (1);
|
||||||
|
|
||||||
if (status_ctx->devices_status != STATUS_RUNNING) continue;
|
if (status_ctx->devices_status != STATUS_RUNNING) continue;
|
||||||
|
|
||||||
|
18
src/shared.c
18
src/shared.c
@ -173,24 +173,6 @@ int hc_fstat (int fd, hc_stat_t *buf)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void hc_sleep_msec (const u32 msec)
|
|
||||||
{
|
|
||||||
#if defined (_WIN)
|
|
||||||
Sleep (msec);
|
|
||||||
#else
|
|
||||||
usleep (msec * 1000);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void hc_sleep (const u32 sec)
|
|
||||||
{
|
|
||||||
#if defined (_WIN)
|
|
||||||
Sleep (sec * 1000);
|
|
||||||
#else
|
|
||||||
sleep (sec);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined (_WIN)
|
#if defined (_WIN)
|
||||||
#define __WINDOWS__
|
#define __WINDOWS__
|
||||||
#endif
|
#endif
|
||||||
|
@ -166,7 +166,7 @@ static void keypress (hashcat_ctx_t *hashcat_ctx)
|
|||||||
user_options_t *user_options = hashcat_ctx->user_options;
|
user_options_t *user_options = hashcat_ctx->user_options;
|
||||||
|
|
||||||
// this is required, because some of the variables down there are not initialized at that point
|
// this is required, because some of the variables down there are not initialized at that point
|
||||||
while (status_ctx->devices_status == STATUS_INIT) hc_sleep_msec (100);
|
while (status_ctx->devices_status == STATUS_INIT) usleep (100000);
|
||||||
|
|
||||||
const bool quiet = user_options->quiet;
|
const bool quiet = user_options->quiet;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ BOOL WINAPI sigHandler_default (DWORD sig)
|
|||||||
|
|
||||||
SetConsoleCtrlHandler (NULL, TRUE);
|
SetConsoleCtrlHandler (NULL, TRUE);
|
||||||
|
|
||||||
hc_sleep (10);
|
sleep (10);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ BOOL WINAPI sigHandler_benchmark (DWORD sig)
|
|||||||
|
|
||||||
SetConsoleCtrlHandler (NULL, TRUE);
|
SetConsoleCtrlHandler (NULL, TRUE);
|
||||||
|
|
||||||
hc_sleep (10);
|
sleep (10);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user