comparison src/os/unix/ngx_process.c @ 391:b670db10cbbd

nginx-0.0.7-2004-07-14-20:01:42 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 14 Jul 2004 16:01:42 +0000
parents 537de4dca8ca
children da8c5707af39
comparison
equal deleted inserted replaced
390:1471c6fb108a 391:b670db10cbbd
1 1
2 #include <ngx_config.h> 2 #include <ngx_config.h>
3 #include <ngx_core.h> 3 #include <ngx_core.h>
4 #include <ngx_event.h> 4 #include <ngx_event.h>
5 #include <ngx_channel.h>
5 6
6 7
7 static void ngx_execute_proc(ngx_cycle_t *cycle, void *data); 8 static void ngx_execute_proc(ngx_cycle_t *cycle, void *data);
8 9
9 ngx_int_t ngx_process_slot; 10 ngx_int_t ngx_process_slot;
47 { 48 {
48 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 49 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
49 "socketpair() failed while spawning \"%s\"", name); 50 "socketpair() failed while spawning \"%s\"", name);
50 return NGX_ERROR; 51 return NGX_ERROR;
51 } 52 }
53
54 ngx_log_debug2(NGX_LOG_DEBUG_CORE, cycle->log, 0,
55 "channel %d:%d",
56 ngx_processes[s].channel[0],
57 ngx_processes[s].channel[1]);
52 58
53 if (ngx_nonblocking(ngx_processes[s].channel[0]) == -1) { 59 if (ngx_nonblocking(ngx_processes[s].channel[0]) == -1) {
54 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 60 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
55 ngx_nonblocking_n " failed while spawning \"%s\"", 61 ngx_nonblocking_n " failed while spawning \"%s\"",
56 name); 62 name);
268 process, pid, WEXITSTATUS(status)); 274 process, pid, WEXITSTATUS(status));
269 ngx_processes[i].respawn = 0; 275 ngx_processes[i].respawn = 0;
270 } 276 }
271 } 277 }
272 } 278 }
273
274
275 void ngx_close_channel(ngx_fd_t *fd, ngx_log_t *log)
276 {
277 if (close(fd[0]) == -1) {
278 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "close() failed");
279 }
280
281 if (close(fd[1]) == -1) {
282 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "close() failed");
283 }
284 }