]> git.kaiwu.me - nginx.git/commitdiff
Fixed the NGX_UNIX_ADDRSTRLEN macro.
authorRuslan Ermilov <ru@nginx.com>
Mon, 25 Sep 2017 12:19:24 +0000 (15:19 +0300)
committerRuslan Ermilov <ru@nginx.com>
Mon, 25 Sep 2017 12:19:24 +0000 (15:19 +0300)
src/core/ngx_inet.h

index 538771e113f1f8a5284314722e8ea5cd8265426e..a3b392ee76623d8d7307e2c338257a95b6e19d4f 100644 (file)
 #define NGX_INET6_ADDRSTRLEN                                                 \
     (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") - 1)
 #define NGX_UNIX_ADDRSTRLEN                                                  \
-    (sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path))
+    (sizeof("unix:") - 1 +                                                   \
+     sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path))
 
 #if (NGX_HAVE_UNIX_DOMAIN)
-#define NGX_SOCKADDR_STRLEN   (sizeof("unix:") - 1 + NGX_UNIX_ADDRSTRLEN)
+#define NGX_SOCKADDR_STRLEN   NGX_UNIX_ADDRSTRLEN
 #elif (NGX_HAVE_INET6)
 #define NGX_SOCKADDR_STRLEN   (NGX_INET6_ADDRSTRLEN + sizeof("[]:65535") - 1)
 #else