Mercurial > hg > nginx
comparison src/os/unix/ngx_process.c @ 5244:593d344999f5
Valgrind: sigaction() failure now ignored.
Valgrind intercepts SIGUSR2 in some cases, and nginx might not be able to
start due to sigaction() failure. If compiled with NGX_VALGRIND defined,
we now ignore the failure of sigaction().
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 05 Jun 2013 19:44:20 +0400 |
parents | a50ed82f19e4 |
children | 2b7dacb381ed |
comparison
equal
deleted
inserted
replaced
5243:ee739104d164 | 5244:593d344999f5 |
---|---|
289 for (sig = signals; sig->signo != 0; sig++) { | 289 for (sig = signals; sig->signo != 0; sig++) { |
290 ngx_memzero(&sa, sizeof(struct sigaction)); | 290 ngx_memzero(&sa, sizeof(struct sigaction)); |
291 sa.sa_handler = sig->handler; | 291 sa.sa_handler = sig->handler; |
292 sigemptyset(&sa.sa_mask); | 292 sigemptyset(&sa.sa_mask); |
293 if (sigaction(sig->signo, &sa, NULL) == -1) { | 293 if (sigaction(sig->signo, &sa, NULL) == -1) { |
294 #if (NGX_VALGRIND) | |
295 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | |
296 "sigaction(%s) failed, ignored", sig->signame); | |
297 #else | |
294 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | 298 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, |
295 "sigaction(%s) failed", sig->signame); | 299 "sigaction(%s) failed", sig->signame); |
296 return NGX_ERROR; | 300 return NGX_ERROR; |
301 #endif | |
297 } | 302 } |
298 } | 303 } |
299 | 304 |
300 return NGX_OK; | 305 return NGX_OK; |
301 } | 306 } |