comparison src/core/nginx.c @ 216:f1d0e5f09c1e

nginx-0.0.1-2003-12-25-23:26:58 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 25 Dec 2003 20:26:58 +0000
parents 679f60139863
children c5d1cdcb04ec
comparison
equal deleted inserted replaced
215:5adc2b75f8a5 216:f1d0e5f09c1e
202 ngx_log_debug(cycle->log, "worker cycle"); 202 ngx_log_debug(cycle->log, "worker cycle");
203 203
204 ngx_process_events(cycle->log); 204 ngx_process_events(cycle->log);
205 205
206 if (done) { 206 if (done) {
207 #if !(WIN32)
207 if (ngx_delete_file(pidfile.name.data) == NGX_FILE_ERROR) { 208 if (ngx_delete_file(pidfile.name.data) == NGX_FILE_ERROR) {
208 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 209 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
209 ngx_delete_file_n " \"%s\" failed", 210 ngx_delete_file_n " \"%s\" failed",
210 pidfile.name.data); 211 pidfile.name.data);
211 } 212 }
213 #endif
212 214
213 ngx_log_error(NGX_LOG_INFO, 215 ngx_log_error(NGX_LOG_INFO,
214 cycle->log, 0, "exiting"); 216 cycle->log, 0, "exiting");
215 exit(0); 217 exit(0);
216 } 218 }
289 291
290 292
291 static ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle, ngx_log_t *log) 293 static ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle, ngx_log_t *log)
292 { 294 {
293 int i, n, failed; 295 int i, n, failed;
294 ngx_fd_t fd;
295 ngx_str_t conf_file; 296 ngx_str_t conf_file;
296 ngx_conf_t conf; 297 ngx_conf_t conf;
297 ngx_pool_t *pool; 298 ngx_pool_t *pool;
298 ngx_cycle_t *cycle, **old; 299 ngx_cycle_t *cycle, **old;
300 ngx_socket_t fd;
299 ngx_core_conf_t *ccf; 301 ngx_core_conf_t *ccf;
300 ngx_open_file_t *file; 302 ngx_open_file_t *file;
301 ngx_listening_t *ls, *nls; 303 ngx_listening_t *ls, *nls;
302 304
303 305
455 * to find a connection we divide a socket number by 4. 457 * to find a connection we divide a socket number by 4.
456 */ 458 */
457 459
458 fd /= 4; 460 fd /= 4;
459 #endif 461 #endif
460 if (fd >= cycle->connection_n) { 462 if (fd >= (ngx_socket_t) cycle->connection_n) {
461 ngx_log_error(NGX_LOG_EMERG, log, 0, 463 ngx_log_error(NGX_LOG_EMERG, log, 0,
462 "%d connections is not enough to hold " 464 "%d connections is not enough to hold "
463 "an open listening socket on %s, " 465 "an open listening socket on %s, "
464 "required at least %d connections", 466 "required at least %d connections",
465 cycle->connection_n, 467 cycle->connection_n,