diff src/os/unix/ngx_process_cycle.c @ 279:b79f021a644a

nginx-0.0.2-2004-03-04-19:34:23 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 04 Mar 2004 16:34:23 +0000
parents 0ba4821f4460
children 87e73f067470
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -95,7 +95,7 @@ void ngx_master_process_cycle(ngx_cycle_
                 if (ngx_modules[i]->init_process) {
                     if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) {
                         /* fatal */
-                        exit(1);
+                        exit(2);
                     }
                 }
             }
@@ -418,7 +418,7 @@ static void ngx_worker_process_cycle(ngx
         if (ngx_modules[i]->init_process) {
             if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) {
                 /* fatal */
-                exit(1);
+                exit(2);
             }
         }
     }
@@ -429,7 +429,7 @@ static void ngx_worker_process_cycle(ngx
 
     if (ngx_init_threads(5, 128 * 1024 * 1024, cycle) == NGX_ERROR) {
         /* fatal */
-        exit(1);
+        exit(2);
     }
 
     for (i = 0; i < 1; i++) {
@@ -437,7 +437,7 @@ static void ngx_worker_process_cycle(ngx
                               cycle, cycle->log) != 0)
         {
             /* fatal */
-            exit(1);
+            exit(2);
         }
     }
 
@@ -494,8 +494,23 @@ int ngx_worker_thread_cycle(void *data)
 {
     ngx_cycle_t *cycle = data;
 
+    ngx_err_t       err;
+    sigset_t        set;
     struct timeval  tv;
 
+    sigfillset(&set);
+    sigdelset(&set, SIGALRM);
+    sigdelset(&set, ngx_signal_value(NGX_TERMINATE_SIGNAL));
+    sigdelset(&set, ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
+
+    err = ngx_thread_sigmask(SIG_BLOCK, &set, NULL);
+    if (err) {
+        ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
+                      ngx_thread_sigmask_n " failed");
+        return 1;
+    }
+
+
     /* STUB */
 
     ngx_log_debug1(NGX_LOG_DEBUG_CORE, ngx_cycle->log, ngx_errno,