]> git.kaiwu.me - nginx.git/commitdiff
nginx-0.0.2-2004-02-04-23:30:08 import
authorIgor Sysoev <igor@sysoev.ru>
Wed, 4 Feb 2004 20:30:08 +0000 (20:30 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 4 Feb 2004 20:30:08 +0000 (20:30 +0000)
src/core/nginx.c
src/event/modules/ngx_poll_module.c
src/os/unix/ngx_posix_init.c

index 21a22d0ba78bf2acc8bc5e37909de6e963f6de7a..43f40c58db68eb387c0e2ddddfb3969a44f6c150 100644 (file)
@@ -221,7 +221,7 @@ int main(int argc, char *const *argv, char **envp)
 }
 
 
-/* TODO: broken single process */
+/* TODO: broken NGX_PROCESS_SINGLE */
 
 static void ngx_master_process_cycle(ngx_cycle_t *cycle, ngx_master_ctx_t *ctx)
 {
@@ -634,6 +634,12 @@ static void ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
         ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "worker cycle");
 
         ngx_process_events(cycle->log);
+
+        if (ngx_reopen) {
+            ngx_log_error(NGX_LOG_INFO, cycle->log, 0, "reopen logs");
+            ngx_reopen_files(cycle, -1);
+            ngx_reopen = 0;
+        }
     }
 }
 
index 8e3175a67178e5867927fa9a5f73b6a216ad3ab6..cba51e0e7a875105c7142248919a2ab91678fc20 100644 (file)
@@ -312,6 +312,13 @@ static int ngx_poll_process_events(ngx_log_t *log)
                           event_list[i].events, event_list[i].revents);
         }
 
+        if (event_list[i].fd == -1) {
+
+            /* the disabled event, workaround for our possible bug */
+
+            continue;
+        }
+
         c = &ngx_cycle->connections[event_list[i].fd];
 
         if (c->fd == -1) {
index b76a9af7544d36acaf2b3307b7e7040d636715fe..4e72339191546acff755d52821c393ba412a155e 100644 (file)
@@ -144,14 +144,9 @@ void ngx_signal_handler(int signo)
             break;
 
         case ngx_signal_value(NGX_REOPEN_SIGNAL):
-            if (ngx_noaccept) {
-                action = ", ignoring";
-
-            } else {
-                ngx_reopen = 1;
-                action = ", reopen logs";
-                break;
-            }
+            ngx_reopen = 1;
+            action = ", reopen logs";
+            break;
 
         case ngx_signal_value(NGX_CHANGEBIN_SIGNAL):
             if ((ngx_inherited && getppid() > 1)