1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-27 02:18:21 +00:00

added locking too, just to be save

This commit is contained in:
philsmd 2016-08-18 11:46:33 +02:00
parent 14677e915f
commit d78deef080

View File

@ -2548,7 +2548,11 @@ static void process_stdout (hc_device_param_t *device_param, const uint pws_cnt)
if (data.outfile != NULL) if (data.outfile != NULL)
{ {
if ((out.fp = fopen (data.outfile, "ab")) == NULL) if ((out.fp = fopen (data.outfile, "ab")) != NULL)
{
lock_file (out.fp);
}
else
{ {
log_error ("ERROR: %s: %s", data.outfile, strerror (errno)); log_error ("ERROR: %s: %s", data.outfile, strerror (errno));
@ -2726,6 +2730,8 @@ static void process_stdout (hc_device_param_t *device_param, const uint pws_cnt)
if (out.fp != stdout) if (out.fp != stdout)
{ {
unlock_file (out.fp);
fclose (out.fp); fclose (out.fp);
} }
} }