]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-thread: fix build with `CURL_DISABLE_SOCKETPAIR`
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Wed, 5 Feb 2025 09:46:30 +0000 (10:46 +0100)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Fri, 7 Feb 2025 14:30:59 +0000 (15:30 +0100)
With `CURL_DISABLE_SOCKETPAIR` defined and `USE_HTTPSRR_ARES`
undefined, the local variable `socketi` was unused.

This fixes a regression from commit 0d4fdbf15d8.

Closes https://github.com/curl/curl/pull/16179

lib/asyn-thread.c

index 8383edad726d5a274e21c3d8eac0270f75d97a53..986fc355c192bb9175e3f0b96457a0abb1a7dc96 100644 (file)
@@ -668,9 +668,11 @@ int Curl_resolver_getsock(struct Curl_easy *data, curl_socket_t *socks)
   timediff_t milli;
   timediff_t ms;
   struct resdata *reslv = (struct resdata *)data->state.async.resolver;
-  int socketi = 0;
 #ifndef CURL_DISABLE_SOCKETPAIR
   struct thread_data *td = data->state.async.tdata;
+#endif
+#if !defined(CURL_DISABLE_SOCKETPAIR) || defined(USE_HTTPSRR_ARES)
+  int socketi = 0;
 #else
   (void)socks;
 #endif