]> git.kaiwu.me - nginx.git/commitdiff
Fixed build with signed socklen_t and unix sockets.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 5 Aug 2013 07:40:33 +0000 (11:40 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 5 Aug 2013 07:40:33 +0000 (11:40 +0400)
This seems to be the case at least under Cygwin, where build was broken
by 05ba5bce31e0 (1.5.3).

Reported by Kevin Worthington,
http://mailman.nginx.org/pipermail/nginx/2013-August/040028.html.

src/core/ngx_inet.c

index 2b5c94c00be4b0f0c2dab106904002b07a80dd2b..bb03720f70fc8791fe4c359b5d425fd817918001 100644 (file)
@@ -233,7 +233,7 @@ ngx_sock_ntop(struct sockaddr *sa, socklen_t socklen, u_char *text, size_t len,
 
         /* on Linux sockaddr might not include sun_path at all */
 
-        if (socklen <= offsetof(struct sockaddr_un, sun_path)) {
+        if (socklen <= (socklen_t) offsetof(struct sockaddr_un, sun_path)) {
             p = ngx_snprintf(text, len, "unix:%Z");
 
         } else {