diff options
author | Yang Tse <yangsita@gmail.com> | 2010-01-29 17:47:54 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-01-29 17:47:54 +0000 |
commit | 6ebd71d186a6437d3472bea991f4298263d3644f (patch) | |
tree | d053e2b8e683534bf2a457248a910538e8a130b0 | |
parent | 4ee4e66c4f0b8bb765f30fffb175ae6cbbca8677 (diff) |
WIN32 fix, _beginthreadex() may return either 0 or -1L upon failure
-rw-r--r-- | lib/curl_threads.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/curl_threads.c b/lib/curl_threads.c index 7c87c19a4..96304e440 100644 --- a/lib/curl_threads.c +++ b/lib/curl_threads.c @@ -101,7 +101,11 @@ curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void*), void #ifdef _WIN32_WCE return CreateThread(NULL, 0, func, arg, 0, NULL); #else - return (curl_thread_t)_beginthreadex(NULL, 0, func, arg, 0, NULL); + curl_thread_t t; + t = (curl_thread_t)_beginthreadex(NULL, 0, func, arg, 0, NULL); + if((t == 0) || (t == (curl_thread_t)-1L)) + return curl_thread_t_null; + return t; #endif } |