mirror of
https://github.com/curl/curl.git
synced 2025-04-24 16:40:32 +08:00
connnect: use sysaddr_un fron sys/un.h or custom-defined for windows
Closes #7737
This commit is contained in:
parent
5de119d0b8
commit
0fe9018e1a
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user