comparison src/os/unix/ngx_process_cycle.c @ 635:e67b227c8dbb default tip

Merge with current.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 25 Apr 2011 04:07:55 +0400
parents 7ea1bba9a4f6
children
comparison
equal deleted inserted replaced
578:f3a9e57d2e17 635:e67b227c8dbb
166 166
167 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "sigsuspend"); 167 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "sigsuspend");
168 168
169 sigsuspend(&set); 169 sigsuspend(&set);
170 170
171 ngx_time_update(0, 0); 171 ngx_time_update();
172 172
173 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 173 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
174 "wake up, sigio %i", sigio); 174 "wake up, sigio %i", sigio);
175 175
176 if (ngx_reap) { 176 if (ngx_reap) {
288 288
289 void 289 void
290 ngx_single_process_cycle(ngx_cycle_t *cycle) 290 ngx_single_process_cycle(ngx_cycle_t *cycle)
291 { 291 {
292 ngx_uint_t i; 292 ngx_uint_t i;
293
294 if (ngx_set_environment(cycle, NULL) == NULL) {
295 /* fatal */
296 exit(2);
297 }
293 298
294 for (i = 0; ngx_modules[i]; i++) { 299 for (i = 0; ngx_modules[i]; i++) {
295 if (ngx_modules[i]->init_process) { 300 if (ngx_modules[i]->init_process) {
296 if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) { 301 if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) {
297 /* fatal */ 302 /* fatal */
854 "setrlimit(RLIMIT_NOFILE, %i) failed", 859 "setrlimit(RLIMIT_NOFILE, %i) failed",
855 ccf->rlimit_nofile); 860 ccf->rlimit_nofile);
856 } 861 }
857 } 862 }
858 863
859 if (ccf->rlimit_core != NGX_CONF_UNSET_SIZE) { 864 if (ccf->rlimit_core != NGX_CONF_UNSET) {
860 rlmt.rlim_cur = (rlim_t) ccf->rlimit_core; 865 rlmt.rlim_cur = (rlim_t) ccf->rlimit_core;
861 rlmt.rlim_max = (rlim_t) ccf->rlimit_core; 866 rlmt.rlim_max = (rlim_t) ccf->rlimit_core;
862 867
863 if (setrlimit(RLIMIT_CORE, &rlmt) == -1) { 868 if (setrlimit(RLIMIT_CORE, &rlmt) == -1) {
864 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 869 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
865 "setrlimit(RLIMIT_CORE, %i) failed", 870 "setrlimit(RLIMIT_CORE, %O) failed",
866 ccf->rlimit_core); 871 ccf->rlimit_core);
867 } 872 }
868 } 873 }
869 874
870 #ifdef RLIMIT_SIGPENDING 875 #ifdef RLIMIT_SIGPENDING
1340 if (path[i]->manager) { 1345 if (path[i]->manager) {
1341 n = path[i]->manager(path[i]->data); 1346 n = path[i]->manager(path[i]->data);
1342 1347
1343 next = (n <= next) ? n : next; 1348 next = (n <= next) ? n : next;
1344 1349
1345 ngx_time_update(0, 0); 1350 ngx_time_update();
1346 } 1351 }
1347 } 1352 }
1348 1353
1349 if (next == 0) { 1354 if (next == 0) {
1350 next = 1; 1355 next = 1;
1370 break; 1375 break;
1371 } 1376 }
1372 1377
1373 if (path[i]->loader) { 1378 if (path[i]->loader) {
1374 path[i]->loader(path[i]->data); 1379 path[i]->loader(path[i]->data);
1375 ngx_time_update(0, 0); 1380 ngx_time_update();
1376 } 1381 }
1377 } 1382 }
1378 1383
1379 exit(0); 1384 exit(0);
1380 } 1385 }