Don't copy 'stderr' for Win-CE in IPv6 code. Don't call
GetCurrentProcess() twice; use a local variable.
This commit is contained in:
parent
2fe3829e5e
commit
06ad5be3af
@ -184,8 +184,10 @@ static unsigned __stdcall gethostbyname_thread (void *arg)
|
|||||||
* due to a resolver timeout.
|
* due to a resolver timeout.
|
||||||
*/
|
*/
|
||||||
HANDLE mutex_waiting = NULL;
|
HANDLE mutex_waiting = NULL;
|
||||||
if (!DuplicateHandle(GetCurrentProcess(), td->mutex_waiting,
|
HANDLE curr_proc = GetCurrentProcess();
|
||||||
GetCurrentProcess(), &mutex_waiting, 0, FALSE,
|
|
||||||
|
if (!DuplicateHandle(curr_proc, td->mutex_waiting,
|
||||||
|
curr_proc, &mutex_waiting, 0, FALSE,
|
||||||
DUPLICATE_SAME_ACCESS)) {
|
DUPLICATE_SAME_ACCESS)) {
|
||||||
/* failed to duplicate the mutex, no point in continuing */
|
/* failed to duplicate the mutex, no point in continuing */
|
||||||
return 0;
|
return 0;
|
||||||
@ -252,14 +254,18 @@ static unsigned __stdcall getaddrinfo_thread (void *arg)
|
|||||||
* due to a resolver timeout.
|
* due to a resolver timeout.
|
||||||
*/
|
*/
|
||||||
HANDLE mutex_waiting = NULL;
|
HANDLE mutex_waiting = NULL;
|
||||||
if (!DuplicateHandle(GetCurrentProcess(), td->mutex_waiting,
|
HANDLE curr_proc = GetCurrentProcess();
|
||||||
GetCurrentProcess(), &mutex_waiting, 0, FALSE,
|
|
||||||
|
if (!DuplicateHandle(curr_proc, td->mutex_waiting,
|
||||||
|
curr_proc, &mutex_waiting, 0, FALSE,
|
||||||
DUPLICATE_SAME_ACCESS)) {
|
DUPLICATE_SAME_ACCESS)) {
|
||||||
/* failed to duplicate the mutex, no point in continuing */
|
/* failed to duplicate the mutex, no point in continuing */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
*stderr = *td->stderr_file;
|
*stderr = *td->stderr_file;
|
||||||
|
#endif
|
||||||
|
|
||||||
itoa(conn->async.port, service, 10);
|
itoa(conn->async.port, service, 10);
|
||||||
|
|
||||||
@ -383,7 +389,6 @@ static bool init_resolve_thread (struct connectdata *conn,
|
|||||||
(LPTHREAD_START_ROUTINE) THREAD_FUNC,
|
(LPTHREAD_START_ROUTINE) THREAD_FUNC,
|
||||||
conn, 0, &td->thread_id);
|
conn, 0, &td->thread_id);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
td->thread_hnd = (HANDLE) _beginthreadex(NULL, 0, THREAD_FUNC,
|
td->thread_hnd = (HANDLE) _beginthreadex(NULL, 0, THREAD_FUNC,
|
||||||
conn, 0, &td->thread_id);
|
conn, 0, &td->thread_id);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user