]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Portability fix for Solaris ('sun' is not usable for a variable).
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 30 Jan 2015 15:32:59 +0000 (15:32 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 30 Jan 2015 15:32:59 +0000 (15:32 +0000)
git-svn-id: file:///svn/unbound/trunk@3326 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/listen_dnsport.c

index 356afa2468ba5e326a51c7d4054536c5071c2fd0..a2ab097b69c7bc92f45083b9c11f890db4aee177 100644 (file)
@@ -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.
index 44a28a60b0032525db36934e9d7f318ff86b731b..1addfa901dbb0d0a20d9d6c275350f04491e465f 100644 (file)
@@ -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));