comparison src/core/ngx_inet.c @ 5313:1fe5f7fb6ced

Fixed build with signed socklen_t and unix sockets. 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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 05 Aug 2013 11:40:33 +0400
parents ec8594b9bf11
children 0300d97c6084
comparison
equal deleted inserted replaced
5312:ec8594b9bf11 5313:1fe5f7fb6ced
231 case AF_UNIX: 231 case AF_UNIX:
232 saun = (struct sockaddr_un *) sa; 232 saun = (struct sockaddr_un *) sa;
233 233
234 /* on Linux sockaddr might not include sun_path at all */ 234 /* on Linux sockaddr might not include sun_path at all */
235 235
236 if (socklen <= offsetof(struct sockaddr_un, sun_path)) { 236 if (socklen <= (socklen_t) offsetof(struct sockaddr_un, sun_path)) {
237 p = ngx_snprintf(text, len, "unix:%Z"); 237 p = ngx_snprintf(text, len, "unix:%Z");
238 238
239 } else { 239 } else {
240 p = ngx_snprintf(text, len, "unix:%s%Z", saun->sun_path); 240 p = ngx_snprintf(text, len, "unix:%s%Z", saun->sun_path);
241 } 241 }