Mercurial > hg > nginx
comparison src/os/unix/ngx_posix_init.c @ 191:71ce40b3c37b
nginx-0.0.1-2003-11-19-19:26:41 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 19 Nov 2003 16:26:41 +0000 |
parents | 4c698194c56d |
children | 8dee38ea9117 |
comparison
equal
deleted
inserted
replaced
190:02a715e85df1 | 191:71ce40b3c37b |
---|---|
11 void ngx_rotate_signal_handler(int signo); | 11 void ngx_rotate_signal_handler(int signo); |
12 | 12 |
13 | 13 |
14 int ngx_posix_init(ngx_log_t *log) | 14 int ngx_posix_init(ngx_log_t *log) |
15 { | 15 { |
16 struct sigaction sa; | 16 struct rlimit rlmt; |
17 struct rlimit rlmt; | 17 struct sigaction sa; |
18 | 18 |
19 ngx_memzero(&sa, sizeof(struct sigaction)); | 19 ngx_memzero(&sa, sizeof(struct sigaction)); |
20 sa.sa_handler = SIG_IGN; | 20 sa.sa_handler = SIG_IGN; |
21 sigemptyset(&sa.sa_mask); | 21 sigemptyset(&sa.sa_mask); |
22 if (sigaction(SIGPIPE, &sa, NULL) == -1) { | 22 if (sigaction(SIGPIPE, &sa, NULL) == -1) { |
23 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | 23 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, |
24 "sigaction(SIGPIPE, SIG_IGN) failed"); | 24 "sigaction(SIGPIPE, SIG_IGN) failed"); |
25 return NGX_ERROR; | |
26 } | |
27 | |
28 ngx_memzero(&sa, sizeof(struct sigaction)); | |
29 sa.sa_handler = ngx_sigchld_handler; | |
30 sigemptyset(&sa.sa_mask); | |
31 if (sigaction(SIGCHLD, &sa, NULL) == -1) { | |
32 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | |
33 "sigaction(SIGCHLD) failed"); | |
25 return NGX_ERROR; | 34 return NGX_ERROR; |
26 } | 35 } |
27 | 36 |
28 sa.sa_handler = ngx_restart_signal_handler; | 37 sa.sa_handler = ngx_restart_signal_handler; |
29 if (sigaction(ngx_signal_value(NGX_RESTART_SIGNAL), &sa, NULL) == -1) { | 38 if (sigaction(ngx_signal_value(NGX_RESTART_SIGNAL), &sa, NULL) == -1) { |