From: Jay Satiro Date: Mon, 6 May 2024 18:49:43 +0000 (-0400) Subject: asyn-thread: fix Curl_thread_create result check X-Git-Tag: curl-8_8_0~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62ae1f10e59423e7924a615c79a08dca081cf6ab;p=thirdparty%2Fcurl.git asyn-thread: fix Curl_thread_create result check - Compare to curl_thread_t_null instead of 0 for error. Currently for both supported thread libraries (pthreads and Windows) curl_thread_t_null is defined as 0. However, the pattern throughout the code is to check against curl_thread_t_null and not 0 since for posterity some thread library may not use 0 for error. Closes https://github.com/curl/curl/pull/13542 --- diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index 87d34a7e43..f537c0b9f3 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -672,7 +672,7 @@ static bool init_resolve_thread(struct Curl_easy *data, td->thread_hnd = Curl_thread_create(gethostbyname_thread, &td->tsd); #endif - if(!td->thread_hnd) { + if(td->thread_hnd == curl_thread_t_null) { /* The thread never started, so mark it as done here for proper cleanup. */ td->tsd.done = 1; err = errno;