comparison src/core/ngx_connection.c @ 5360:3d2d3e1cf427

Win32: MinGW GCC compatibility. Several warnings silenced, notably (ngx_socket_t) -1 is now checked on socket operations instead of -1, as ngx_socket_t is unsigned on win32 and gcc complains on comparison. With this patch, it's now possible to compile nginx using mingw gcc, with options we normally compile on win32.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 04 Sep 2013 20:48:28 +0400
parents 6d73e0dc4f64
children 91bd62a9627e
comparison
equal deleted inserted replaced
5359:2fda9065d0f4 5360:3d2d3e1cf427
295 295
296 if (ls[i].ignore) { 296 if (ls[i].ignore) {
297 continue; 297 continue;
298 } 298 }
299 299
300 if (ls[i].fd != -1) { 300 if (ls[i].fd != (ngx_socket_t) -1) {
301 continue; 301 continue;
302 } 302 }
303 303
304 if (ls[i].inherited) { 304 if (ls[i].inherited) {
305 305
310 continue; 310 continue;
311 } 311 }
312 312
313 s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type, 0); 313 s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type, 0);
314 314
315 if (s == -1) { 315 if (s == (ngx_socket_t) -1) {
316 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, 316 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
317 ngx_socket_n " %V failed", &ls[i].addr_text); 317 ngx_socket_n " %V failed", &ls[i].addr_text);
318 return NGX_ERROR; 318 return NGX_ERROR;
319 } 319 }
320 320
861 { 861 {
862 ngx_err_t err; 862 ngx_err_t err;
863 ngx_uint_t log_error, level; 863 ngx_uint_t log_error, level;
864 ngx_socket_t fd; 864 ngx_socket_t fd;
865 865
866 if (c->fd == -1) { 866 if (c->fd == (ngx_socket_t) -1) {
867 ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed"); 867 ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed");
868 return; 868 return;
869 } 869 }
870 870
871 if (c->read->timer_set) { 871 if (c->read->timer_set) {