From 1cc5194337b1b9a77ec35f557d27ed97d086dfb2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 10 Dec 2014 13:12:26 +0100 Subject: Curl_unix2addr: avoid using the variable name 'sun' I suspect this causes compile failures on Solaris: Bug: http://curl.haxx.se/mail/lib-2014-12/0081.html --- lib/curl_addrinfo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index b8032f4df..f28361062 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -488,7 +488,7 @@ Curl_addrinfo *Curl_str2addr(char *address, int port) Curl_addrinfo *Curl_unix2addr(const char *path) { Curl_addrinfo *ai; - struct sockaddr_un *sun; + struct sockaddr_un *sa_un; size_t path_len; ai = calloc(1, sizeof(Curl_addrinfo)); @@ -500,7 +500,7 @@ Curl_addrinfo *Curl_unix2addr(const char *path) } /* sun_path must be able to store the NUL-terminated path */ path_len = strlen(path); - if(path_len >= sizeof(sun->sun_path)) { + if(path_len >= sizeof(sa_un->sun_path)) { free(ai->ai_addr); free(ai); return NULL; @@ -509,9 +509,9 @@ Curl_addrinfo *Curl_unix2addr(const char *path) ai->ai_family = AF_UNIX; ai->ai_socktype = SOCK_STREAM; /* assume reliable transport for HTTP */ ai->ai_addrlen = (curl_socklen_t) sizeof(struct sockaddr_un); - sun = (void *) ai->ai_addr; - sun->sun_family = AF_UNIX; - memcpy(sun->sun_path, path, path_len + 1); /* copy NUL byte */ + sa_un = (void *) ai->ai_addr; + sa_un->sun_family = AF_UNIX; + memcpy(sa_un->sun_path, path, path_len + 1); /* copy NUL byte */ return ai; } #endif -- cgit v1.2.3