]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
connnect: use sysaddr_un fron sys/un.h or custom-defined for windows
authorJan Mazur <mzr@fb.com>
Tue, 28 Sep 2021 23:13:59 +0000 (00:13 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 30 Sep 2021 10:27:47 +0000 (12:27 +0200)
Closes #7737

lib/connect.c
lib/curl_setup.h

index 48c98ebd454cd6c0616dcf823afcda059505f497..94490805ad58bf7791abb63d38cb2a5fd471a15c 100644 (file)
@@ -629,7 +629,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
 #ifdef ENABLE_IPV6
   struct sockaddr_in6 *si6 = NULL;
 #endif
-#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
+#if (defined(HAVE_SYS_UN_H) || defined(WIN32_SOCKADDR_UN)) && defined(AF_UNIX)
   struct sockaddr_un *su = NULL;
 #else
   (void)salen;
@@ -656,7 +656,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
       }
       break;
 #endif
-#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
+#if (defined(HAVE_SYS_UN_H) || defined(WIN32_SOCKADDR_UN)) && defined(AF_UNIX)
     case AF_UNIX:
       if(salen > (curl_socklen_t)sizeof(CURL_SA_FAMILY_T)) {
         su = (struct sockaddr_un*)sa;
index 3840636f64be5b100591084f97a1edf36d51b589..61384cdff6ad32d429128d99e56578f1ca1d8a07 100644 (file)
@@ -838,6 +838,7 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf,
        ADDRESS_FAMILY sun_family;
        char sun_path[UNIX_PATH_MAX];
      } SOCKADDR_UN, *PSOCKADDR_UN;
+#    define WIN32_SOCKADDR_UN
 #  endif
 #endif