From 62ae1f10e59423e7924a615c79a08dca081cf6ab Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Mon, 6 May 2024 14:49:43 -0400 Subject: [PATCH] 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 --- lib/asyn-thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3