comparison src/event/ngx_event.c @ 290:87e73f067470

nginx-0.0.2-2004-03-16-10:10:12 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 16 Mar 2004 07:10:12 +0000
parents f81d075ad172
children 744965ec6275
comparison
equal deleted inserted replaced
289:0750faf8d7e3 290:87e73f067470
124 }; 124 };
125 125
126 126
127 static int ngx_event_init(ngx_cycle_t *cycle) 127 static int ngx_event_init(ngx_cycle_t *cycle)
128 { 128 {
129 int m, i, fd; 129 ngx_uint_t m, i;
130 ngx_socket_t fd;
130 ngx_event_t *rev, *wev; 131 ngx_event_t *rev, *wev;
131 ngx_listening_t *s; 132 ngx_listening_t *s;
132 ngx_connection_t *c; 133 ngx_connection_t *c;
133 ngx_event_conf_t *ecf; 134 ngx_event_conf_t *ecf;
134 ngx_event_module_t *module; 135 ngx_event_module_t *module;
172 return NGX_ERROR; 173 return NGX_ERROR;
173 } 174 }
174 175
175 c = cycle->connections; 176 c = cycle->connections;
176 for (i = 0; i < cycle->connection_n; i++) { 177 for (i = 0; i < cycle->connection_n; i++) {
177 c[i].fd = -1; 178 c[i].fd = (ngx_socket_t) -1;
178 } 179 }
179 180
180 cycle->read_events = ngx_alloc(sizeof(ngx_event_t) * ecf->connections, 181 cycle->read_events = ngx_alloc(sizeof(ngx_event_t) * ecf->connections,
181 cycle->log); 182 cycle->log);
182 if (cycle->read_events == NULL) { 183 if (cycle->read_events == NULL) {
248 NGX_READ_EVENT, NGX_CLOSE_EVENT) == NGX_ERROR) 249 NGX_READ_EVENT, NGX_CLOSE_EVENT) == NGX_ERROR)
249 { 250 {
250 return NGX_ERROR; 251 return NGX_ERROR;
251 } 252 }
252 253
253 cycle->old_cycle->connections[fd].fd = -1; 254 cycle->old_cycle->connections[fd].fd = (ngx_socket_t) -1;
254 } 255 }
255 } 256 }
256 257
257 #if (WIN32) 258 #if (WIN32)
258 259