Mercurial > hg > nginx
comparison src/os/unix/ngx_process.c @ 226:b0c1e21e68db
nginx-0.0.1-2004-01-14-00:33:59 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 13 Jan 2004 21:33:59 +0000 |
parents | 2e9a8a14a0cf |
children | 2ba3477070ac |
comparison
equal
deleted
inserted
replaced
225:2e9a8a14a0cf | 226:b0c1e21e68db |
---|---|
83 | 83 |
84 return pid; | 84 return pid; |
85 } | 85 } |
86 | 86 |
87 | 87 |
88 ngx_int_t ngx_exec(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx) | 88 ngx_pid_t ngx_exec(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx) |
89 { | 89 { |
90 if (ngx_spawn_process(cycle, ngx_exec_proc, ctx, ctx->name, | 90 return ngx_spawn_process(cycle, ngx_exec_proc, ctx, ctx->name, |
91 NGX_PROCESS_DETACHED) == NGX_ERROR) | 91 NGX_PROCESS_DETACHED); |
92 { | |
93 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | |
94 "can not spawn %s", ctx->name); | |
95 return NGX_ERROR; | |
96 } | |
97 | |
98 return NGX_OK; | |
99 } | 92 } |
100 | 93 |
101 | 94 |
102 static void ngx_exec_proc(ngx_cycle_t *cycle, void *data) | 95 static void ngx_exec_proc(ngx_cycle_t *cycle, void *data) |
103 { | 96 { |
152 void ngx_respawn_processes(ngx_cycle_t *cycle) | 145 void ngx_respawn_processes(ngx_cycle_t *cycle) |
153 { | 146 { |
154 ngx_uint_t i; | 147 ngx_uint_t i; |
155 | 148 |
156 for (i = 0; i < ngx_last_process; i++) { | 149 for (i = 0; i < ngx_last_process; i++) { |
150 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cycle->log, 0, | |
151 "proc table " PID_T_FMT, ngx_processes[i].pid); | |
152 | |
157 if (ngx_processes[i].exiting || !ngx_processes[i].exited) { | 153 if (ngx_processes[i].exiting || !ngx_processes[i].exited) { |
158 continue; | 154 continue; |
159 } | 155 } |
160 | 156 |
161 if (!ngx_processes[i].respawn) { | 157 if (!ngx_processes[i].respawn) { |