nginx-0.0.1-2003-07-03-20:30:22 import
diff --git a/src/os/unix/ngx_posix_init.c b/src/os/unix/ngx_posix_init.c
index aadb64c..364df11 100644
--- a/src/os/unix/ngx_posix_init.c
+++ b/src/os/unix/ngx_posix_init.c
@@ -7,6 +7,10 @@
int ngx_inherited_nonblocking;
+void ngx_restart_signal_handler(int signo);
+void ngx_rotate_signal_handler(int signo);
+
+
int ngx_posix_init(ngx_log_t *log)
{
struct sigaction sa;
@@ -15,13 +19,26 @@
ngx_memzero(&sa, sizeof(struct sigaction));
sa.sa_handler = SIG_IGN;
sigemptyset(&sa.sa_mask);
-
if (sigaction(SIGPIPE, &sa, NULL) == -1) {
ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
"sigaction(SIGPIPE, SIG_IGN) failed");
return NGX_ERROR;
}
+ sa.sa_handler = ngx_restart_signal_handler;
+ if (sigaction(SIGHUP, &sa, NULL) == -1) {
+ ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
+ "sigaction(SIGHUP) failed");
+ return NGX_ERROR;
+ }
+
+ sa.sa_handler = ngx_rotate_signal_handler;
+ if (sigaction(SIGUSR1, &sa, NULL) == -1) {
+ ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
+ "sigaction(SIGUSR1) failed");
+ return NGX_ERROR;
+ }
+
if (getrlimit(RLIMIT_NOFILE, &rlmt) == -1) {
ngx_log_error(NGX_LOG_ALERT, log, errno,
@@ -45,6 +62,18 @@
}
+void ngx_restart_signal_handler(int signo)
+{
+ restart = 1;
+}
+
+
+void ngx_rotate_signal_handler(int signo)
+{
+ rotate = 1;
+}
+
+
int ngx_posix_post_conf_init(ngx_log_t *log)
{
ngx_fd_t pp[2];