diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-08-10 17:07:15 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-08-10 17:07:15 +0400 |
commit | 07b280a29f425d0da024cc9ab2987dd23f792386 (patch) | |
tree | dc0f73eb7170adffac983750c1cefc081a706783 /src/os/unix | |
parent | fe8726404cff0d057348e98f24528609db37bd18 (diff) |
introduce NGX_PROCESS_JUST_SPAWN and change field name accordingly
Diffstat (limited to 'src/os/unix')
-rw-r--r-- | src/os/unix/ngx_process.c | 18 | ||||
-rw-r--r-- | src/os/unix/ngx_process.h | 9 | ||||
-rw-r--r-- | src/os/unix/ngx_process_cycle.c | 8 |
3 files changed, 24 insertions, 11 deletions
diff --git a/src/os/unix/ngx_process.c b/src/os/unix/ngx_process.c index 7446c138b..c92802ef9 100644 --- a/src/os/unix/ngx_process.c +++ b/src/os/unix/ngx_process.c @@ -214,21 +214,33 @@ ngx_spawn_process(ngx_cycle_t *cycle, ngx_spawn_proc_pt proc, void *data, switch (respawn) { + case NGX_PROCESS_NORESPAWN: + ngx_processes[s].respawn = 0; + ngx_processes[s].just_spawn = 0; + ngx_processes[s].detached = 0; + break; + + case NGX_PROCESS_JUST_SPAWN: + ngx_processes[s].respawn = 0; + ngx_processes[s].just_spawn = 1; + ngx_processes[s].detached = 0; + break; + case NGX_PROCESS_RESPAWN: ngx_processes[s].respawn = 1; - ngx_processes[s].just_respawn = 0; + ngx_processes[s].just_spawn = 0; ngx_processes[s].detached = 0; break; case NGX_PROCESS_JUST_RESPAWN: ngx_processes[s].respawn = 1; - ngx_processes[s].just_respawn = 1; + ngx_processes[s].just_spawn = 1; ngx_processes[s].detached = 0; break; case NGX_PROCESS_DETACHED: ngx_processes[s].respawn = 0; - ngx_processes[s].just_respawn = 0; + ngx_processes[s].just_spawn = 0; ngx_processes[s].detached = 1; break; } diff --git a/src/os/unix/ngx_process.h b/src/os/unix/ngx_process.h index a34ca6142..aba0b5169 100644 --- a/src/os/unix/ngx_process.h +++ b/src/os/unix/ngx_process.h @@ -27,7 +27,7 @@ typedef struct { char *name; unsigned respawn:1; - unsigned just_respawn:1; + unsigned just_spawn:1; unsigned detached:1; unsigned exiting:1; unsigned exited:1; @@ -45,9 +45,10 @@ typedef struct { #define NGX_MAX_PROCESSES 1024 #define NGX_PROCESS_NORESPAWN -1 -#define NGX_PROCESS_RESPAWN -2 -#define NGX_PROCESS_JUST_RESPAWN -3 -#define NGX_PROCESS_DETACHED -4 +#define NGX_PROCESS_JUST_SPAWN -2 +#define NGX_PROCESS_RESPAWN -3 +#define NGX_PROCESS_JUST_RESPAWN -4 +#define NGX_PROCESS_DETACHED -5 #define ngx_getpid getpid diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index 92f6bf6f3..90705596e 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -456,14 +456,14 @@ ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo) ngx_processes[i].exited, ngx_processes[i].detached, ngx_processes[i].respawn, - ngx_processes[i].just_respawn); + ngx_processes[i].just_spawn); if (ngx_processes[i].detached || ngx_processes[i].pid == -1) { continue; } - if (ngx_processes[i].just_respawn) { - ngx_processes[i].just_respawn = 0; + if (ngx_processes[i].just_spawn) { + ngx_processes[i].just_spawn = 0; continue; } @@ -533,7 +533,7 @@ ngx_reap_children(ngx_cycle_t *cycle) ngx_processes[i].exited, ngx_processes[i].detached, ngx_processes[i].respawn, - ngx_processes[i].just_respawn); + ngx_processes[i].just_spawn); if (ngx_processes[i].pid == -1) { continue; |