]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
socketpair: fix compilation when USE_UNIX_SOCKETS is not defined
authorAntoine Bollengier <44288655+b5i@users.noreply.github.com>
Wed, 15 May 2024 20:46:05 +0000 (22:46 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 16 May 2024 08:50:02 +0000 (10:50 +0200)
Closes #13666

lib/socketpair.h

index bd499abbef0855b18efb1b8da6b886fe7f7b3039..09d975477a84c654e015ba2625981c461c338f7e 100644 (file)
 #define wakeup_write     swrite
 #define wakeup_read      sread
 #define wakeup_close     sclose
-#define wakeup_create(p) Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, p)
+
+#if defined(USE_UNIX_SOCKETS) && defined(HAVE_SOCKETPAIR)
+#define SOCKET_FAMILY AF_UNIX
+#elif !defined(HAVE_SOCKETPAIR)
+#define SOCKET_FAMILY 0 /* not used */
+#else
+#error "unsupported unix domain and socketpair build combo"
+#endif
+
+#define wakeup_create(p) Curl_socketpair(SOCKET_FAMILY, SOCK_STREAM, 0, p)
 
 #endif /* HAVE_PIPE */