Mercurial > hg > nginx
comparison src/os/unix/ngx_process.c @ 3587:e1409e56ba7c stable-0.7
merge r3473, r3474, r3385, r3386, r3537:
signal processing stability:
*) use sys_errlist[] in signal handler instead
of non Async-Signal-Safe strerror_r()
*) do not update time in the timer signal handler,
since localtime_r() is not Async-Signal-Safe function
*) use previously cached GMT offset value to update time from a signal handler
*) change ngx_time_update() interface since there are no notification methods
those return time
*) introduce ngx_time_sigsafe_update() to update the error log time only
*) change ngx_time_update() interface
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Jun 2010 10:35:08 +0000 |
parents | 1f3cd08ebb82 |
children |
comparison
equal
deleted
inserted
replaced
3586:2d21e02fc01d | 3587:e1409e56ba7c |
---|---|
313 if (sig->signo == signo) { | 313 if (sig->signo == signo) { |
314 break; | 314 break; |
315 } | 315 } |
316 } | 316 } |
317 | 317 |
318 ngx_time_update(0, 0); | 318 ngx_time_sigsafe_update(); |
319 | 319 |
320 action = ""; | 320 action = ""; |
321 | 321 |
322 switch (ngx_process) { | 322 switch (ngx_process) { |
323 | 323 |
474 * erroneously call the signal handler for exited process | 474 * erroneously call the signal handler for exited process |
475 * despite waitpid() may be already called for this process. | 475 * despite waitpid() may be already called for this process. |
476 */ | 476 */ |
477 | 477 |
478 if (err == NGX_ECHILD) { | 478 if (err == NGX_ECHILD) { |
479 ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, errno, | 479 ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, 0, |
480 "waitpid() failed"); | 480 "waitpid() failed (%d: %s)", |
481 err, ngx_sigsafe_strerror(err)); | |
481 return; | 482 return; |
482 } | 483 } |
483 | 484 |
484 #endif | 485 #endif |
485 | 486 |
486 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, errno, | 487 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, |
487 "waitpid() failed"); | 488 "waitpid() failed (%d: %s)", |
488 | 489 err, ngx_sigsafe_strerror(err)); |
489 return; | 490 return; |
490 } | 491 } |
491 | 492 |
492 | 493 |
493 if (ngx_accept_mutex_ptr) { | 494 if (ngx_accept_mutex_ptr) { |