comparison src/os/unix/ngx_process.c @ 665:0b460e61bdcd default tip

Merge with nginx 1.0.0.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 25 Apr 2011 04:22:17 +0400
parents 428c6e58046a
children
comparison
equal deleted inserted replaced
572:06419a2298a9 665:0b460e61bdcd
9 #include <ngx_event.h> 9 #include <ngx_event.h>
10 #include <ngx_channel.h> 10 #include <ngx_channel.h>
11 11
12 12
13 typedef struct { 13 typedef struct {
14 int signo; 14 int signo;
15 char *signame; 15 char *signame;
16 char *name; 16 char *name;
17 void (*handler)(int signo); 17 void (*handler)(int signo);
18 } ngx_signal_t; 18 } ngx_signal_t;
19 19
20 20
21 21
22 static void ngx_execute_proc(ngx_cycle_t *cycle, void *data); 22 static void ngx_execute_proc(ngx_cycle_t *cycle, void *data);
315 if (sig->signo == signo) { 315 if (sig->signo == signo) {
316 break; 316 break;
317 } 317 }
318 } 318 }
319 319
320 ngx_time_update(0, 0); 320 ngx_time_sigsafe_update();
321 321
322 action = ""; 322 action = "";
323 323
324 switch (ngx_process) { 324 switch (ngx_process) {
325 325
386 } 386 }
387 387
388 break; 388 break;
389 389
390 case NGX_PROCESS_WORKER: 390 case NGX_PROCESS_WORKER:
391 case NGX_PROCESS_HELPER:
391 switch (signo) { 392 switch (signo) {
392 393
393 case ngx_signal_value(NGX_NOACCEPT_SIGNAL): 394 case ngx_signal_value(NGX_NOACCEPT_SIGNAL):
394 ngx_debug_quit = 1; 395 ngx_debug_quit = 1;
395 case ngx_signal_value(NGX_SHUTDOWN_SIGNAL): 396 case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
476 * erroneously call the signal handler for exited process 477 * erroneously call the signal handler for exited process
477 * despite waitpid() may be already called for this process. 478 * despite waitpid() may be already called for this process.
478 */ 479 */
479 480
480 if (err == NGX_ECHILD) { 481 if (err == NGX_ECHILD) {
481 ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, errno, 482 ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, err,
482 "waitpid() failed"); 483 "waitpid() failed");
483 return; 484 return;
484 } 485 }
485 486
486 #endif 487 #endif
487 488
488 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, errno, 489 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err,
489 "waitpid() failed"); 490 "waitpid() failed");
490
491 return; 491 return;
492 } 492 }
493 493
494 494
495 if (ngx_accept_mutex_ptr) { 495 if (ngx_accept_mutex_ptr) {