From: Wouter Wijngaards Date: Fri, 30 Jan 2015 15:32:59 +0000 (+0000) Subject: - Portability fix for Solaris ('sun' is not usable for a variable). X-Git-Tag: release-1.5.2rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83ba5ffcf45c9b7a2dfc3004787e1c1b512612dd;p=thirdparty%2Funbound.git - Portability fix for Solaris ('sun' is not usable for a variable). git-svn-id: file:///svn/unbound/trunk@3326 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 356afa246..a2ab097b6 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 30 January 2015: Wouter - Fix 0x20 capsforid fallback to omit gratuitous NS and additional section changes. + - Portability fix for Solaris ('sun' is not usable for a variable). 29 January 2015: Wouter - Fix pyunbound byte string representation for python3. diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index 44a28a60b..1addfa901 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -598,16 +598,16 @@ create_local_accept_sock(const char *path, int* noproto) { #ifdef HAVE_SYS_UN_H int s; - struct sockaddr_un sun; + struct sockaddr_un usock; verbose(VERB_ALGO, "creating unix socket %s", path); #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN /* this member exists on BSDs, not Linux */ - sun.sun_len = (socklen_t)sizeof(sun); + usock.sun_len = (socklen_t)sizeof(usock); #endif - sun.sun_family = AF_LOCAL; + usock.sun_family = AF_LOCAL; /* length is 92-108, 104 on FreeBSD */ - (void)strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); + (void)strlcpy(usock.sun_path, path, sizeof(usock.sun_path)); if ((s = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1) { log_err("Cannot create local socket %s (%s)", @@ -622,7 +622,7 @@ create_local_accept_sock(const char *path, int* noproto) return -1; } - if (bind(s, (struct sockaddr *)&sun, + if (bind(s, (struct sockaddr *)&usock, (socklen_t)sizeof(struct sockaddr_un)) == -1) { log_err("Cannot bind local socket %s (%s)", path, strerror(errno));