1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-06-04 07:08:49 +00:00
This commit is contained in:
Jens Steube 2020-03-10 09:43:17 +01:00
commit c0554af987

View File

@ -369,31 +369,24 @@ static bool opencl_test_instruction (hashcat_ctx_t *hashcat_ctx, cl_context cont
OCL_PTR *ocl = (OCL_PTR *) backend_ctx->ocl; OCL_PTR *ocl = (OCL_PTR *) backend_ctx->ocl;
// LLVM seems to write an error message (if there's an error) directly to stderr const int fd_stderr = fileno (stderr);
// and not (as supposted to) into buffer for later request using clGetProgramBuildInfo()
#ifndef DEBUG #ifndef DEBUG
#ifndef _WIN const int stderr_bak = dup (fd_stderr);
fflush (stderr); #ifdef _WIN
int bak = fcntl(2, F_DUPFD_CLOEXEC); const int tmp = open ("NUL", O_WRONLY);
int tmp = open ("/dev/null", O_WRONLY | O_CLOEXEC); #else
dup2 (tmp, 2); const int tmp = open ("/dev/null", O_WRONLY);
#endif
dup2 (tmp, fd_stderr);
close (tmp); close (tmp);
#endif #endif
#endif
int CL_rc = ocl->clBuildProgram (program, 1, &device, "-Werror", NULL, NULL); // do not use the wrapper to avoid the error message const int CL_rc = ocl->clBuildProgram (program, 1, &device, NULL, NULL, NULL);
#ifndef DEBUG #ifndef DEBUG
#ifndef _WIN dup2 (stderr_bak, fd_stderr);
fflush (stderr); close (stderr_bak);
#ifndef __APPLE__
dup3 (bak, 2, O_CLOEXEC);
#else
dup2 (bak, 2);
#endif
close (bak);
#endif
#endif #endif
if (CL_rc != CL_SUCCESS) if (CL_rc != CL_SUCCESS)