comparison src/os/unix/ngx_process.c @ 225:2e9a8a14a0cf

nginx-0.0.1-2004-01-13-19:43:23 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 13 Jan 2004 16:43:23 +0000
parents d427f1c3fe95
children b0c1e21e68db
comparison
equal deleted inserted replaced
224:d427f1c3fe95 225:2e9a8a14a0cf
7 7
8 ngx_uint_t ngx_last_process; 8 ngx_uint_t ngx_last_process;
9 ngx_process_t ngx_processes[NGX_MAX_PROCESSES]; 9 ngx_process_t ngx_processes[NGX_MAX_PROCESSES];
10 10
11 11
12 ngx_int_t ngx_spawn_process(ngx_cycle_t *cycle, 12 ngx_pid_t ngx_spawn_process(ngx_cycle_t *cycle,
13 ngx_spawn_proc_pt proc, void *data, 13 ngx_spawn_proc_pt proc, void *data,
14 char *name, ngx_int_t respawn) 14 char *name, ngx_int_t respawn)
15 { 15 {
16 sigset_t set, oset; 16 sigset_t set, oset;
17 ngx_pid_t pid; 17 ngx_pid_t pid;
57 "spawn %s: " PID_T_FMT, name, pid); 57 "spawn %s: " PID_T_FMT, name, pid);
58 58
59 if (respawn >= 0) { 59 if (respawn >= 0) {
60 ngx_processes[respawn].pid = pid; 60 ngx_processes[respawn].pid = pid;
61 ngx_processes[respawn].exited = 0; 61 ngx_processes[respawn].exited = 0;
62 return NGX_OK; 62 return pid;
63 } 63 }
64 64
65 ngx_processes[ngx_last_process].pid = pid; 65 ngx_processes[ngx_last_process].pid = pid;
66 ngx_processes[ngx_last_process].proc = proc; 66 ngx_processes[ngx_last_process].proc = proc;
67 ngx_processes[ngx_last_process].data = data; 67 ngx_processes[ngx_last_process].data = data;
79 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 79 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
80 "sigprocmask() failed while spawning %s", name); 80 "sigprocmask() failed while spawning %s", name);
81 return NGX_ERROR; 81 return NGX_ERROR;
82 } 82 }
83 83
84 return NGX_OK; 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_int_t ngx_exec(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx)
89 { 89 {