From 4e77a2bb83260015bd60156916178f0eb658da82 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 9 Jan 2007 15:59:20 +0000 Subject: pass the inherited shm_zone data --- src/core/ngx_cycle.c | 9 ++++++++- src/core/ngx_cycle.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index ff4888ab2..2fd20b01b 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -402,6 +402,13 @@ ngx_init_cycle(ngx_cycle_t *old_cycle) if (shm_zone[i].shm.size == oshm_zone[n].shm.size) { shm_zone[i].shm.addr = oshm_zone[n].shm.addr; + + if (shm_zone[i].init(&shm_zone[i], oshm_zone[n].data) + != NGX_OK) + { + goto failed; + } + goto found; } @@ -446,7 +453,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle) ngx_slab_init(shpool); - if (shm_zone[i].init(&shm_zone[i]) != NGX_OK) { + if (shm_zone[i].init(&shm_zone[i], NULL) != NGX_OK) { goto failed; } diff --git a/src/core/ngx_cycle.h b/src/core/ngx_cycle.h index 598fbb93d..21fb86acf 100644 --- a/src/core/ngx_cycle.h +++ b/src/core/ngx_cycle.h @@ -23,7 +23,7 @@ typedef struct ngx_shm_zone_s ngx_shm_zone_t; -typedef ngx_int_t (*ngx_shm_zone_init_pt) (ngx_shm_zone_t *zone); +typedef ngx_int_t (*ngx_shm_zone_init_pt) (ngx_shm_zone_t *zone, void *data); struct ngx_shm_zone_s { void *data; -- cgit