diff options
author | Gisle Vanem <gvanem@broadpark.no> | 2005-01-19 10:20:55 +0000 |
---|---|---|
committer | Gisle Vanem <gvanem@broadpark.no> | 2005-01-19 10:20:55 +0000 |
commit | 06ad5be3af79adc302fd985c54a7c15e501985fd (patch) | |
tree | 8edcaee8dea091f08c43c57cfa8eae91013d117d | |
parent | 2fe3829e5eafe2659a9ce32ad6532a1b037d3485 (diff) |
Don't copy 'stderr' for Win-CE in IPv6 code. Don't call
GetCurrentProcess() twice; use a local variable.
-rw-r--r-- | lib/hostthre.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/hostthre.c b/lib/hostthre.c index 7cb31f487..01625e6a9 100644 --- a/lib/hostthre.c +++ b/lib/hostthre.c @@ -184,8 +184,10 @@ static unsigned __stdcall gethostbyname_thread (void *arg) * due to a resolver timeout. */ HANDLE mutex_waiting = NULL; - if (!DuplicateHandle(GetCurrentProcess(), td->mutex_waiting, - GetCurrentProcess(), &mutex_waiting, 0, FALSE, + HANDLE curr_proc = GetCurrentProcess(); + + if (!DuplicateHandle(curr_proc, td->mutex_waiting, + curr_proc, &mutex_waiting, 0, FALSE, DUPLICATE_SAME_ACCESS)) { /* failed to duplicate the mutex, no point in continuing */ return 0; @@ -252,14 +254,18 @@ static unsigned __stdcall getaddrinfo_thread (void *arg) * due to a resolver timeout. */ HANDLE mutex_waiting = NULL; - if (!DuplicateHandle(GetCurrentProcess(), td->mutex_waiting, - GetCurrentProcess(), &mutex_waiting, 0, FALSE, + HANDLE curr_proc = GetCurrentProcess(); + + if (!DuplicateHandle(curr_proc, td->mutex_waiting, + curr_proc, &mutex_waiting, 0, FALSE, DUPLICATE_SAME_ACCESS)) { /* failed to duplicate the mutex, no point in continuing */ return 0; } +#ifndef _WIN32_WCE *stderr = *td->stderr_file; +#endif itoa(conn->async.port, service, 10); @@ -383,7 +389,6 @@ static bool init_resolve_thread (struct connectdata *conn, (LPTHREAD_START_ROUTINE) THREAD_FUNC, conn, 0, &td->thread_id); #else - td->thread_hnd = (HANDLE) _beginthreadex(NULL, 0, THREAD_FUNC, conn, 0, &td->thread_id); #endif |