diff src/os/unix/ngx_process.c @ 360:239e37d44a34

nginx-0.0.7-2004-06-18-20:22:16 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 18 Jun 2004 16:22:16 +0000
parents 0fb6c53fb135
children fd24ba70e1b3
line wrap: on
line diff
--- a/src/os/unix/ngx_process.c
+++ b/src/os/unix/ngx_process.c
@@ -6,9 +6,9 @@
 
 static void ngx_execute_proc(ngx_cycle_t *cycle, void *data);
 
-ngx_int_t      ngx_current_slot;
+ngx_int_t      ngx_process_slot;
+ngx_socket_t   ngx_channel;
 ngx_int_t      ngx_last_process;
-ngx_socket_t   ngx_channel;
 ngx_process_t  ngx_processes[NGX_MAX_PROCESSES];
 
 
@@ -31,6 +31,18 @@ ngx_pid_t ngx_spawn_process(ngx_cycle_t 
         return NGX_ERROR;
     }
 
+    if (ngx_nonblocking(ngx_processes[s].channel[0]) == -1) {
+        ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
+                      ngx_nonblocking_n " failed while spawning \"%s\"", name);
+        return NGX_ERROR;
+    }
+
+    if (ngx_nonblocking(ngx_processes[s].channel[1]) == -1) {
+        ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
+                      ngx_nonblocking_n " failed while spawning \"%s\"", name);
+        return NGX_ERROR;
+    }
+
     on = 1;
     if (ioctl(ngx_processes[s].channel[0], FIOASYNC, &on) == -1) {
         ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
@@ -45,7 +57,7 @@ ngx_pid_t ngx_spawn_process(ngx_cycle_t 
     }
 
     ngx_channel = ngx_processes[s].channel[1];
-    ngx_current_slot = s;
+    ngx_process_slot = s;
 
 
     pid = fork();