aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_cycle.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-04-18 11:28:11 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-04-18 11:28:11 +0000
commite5e4c0000d1fa5a387c32bba0fd4fcad53fd3e9f (patch)
tree9cb425afe515d6a3b5b1d8bf79fe26970ffce2c5 /src/core/ngx_cycle.c
parent5dbc83df060fb4593a4e1f1006ed999858b26c0c (diff)
downloadnginx-e5e4c0000d1fa5a387c32bba0fd4fcad53fd3e9f.tar.gz
nginx-e5e4c0000d1fa5a387c32bba0fd4fcad53fd3e9f.zip
fix segfault when
*) perl was built without multiplicity *) when configuration was invalid
Diffstat (limited to 'src/core/ngx_cycle.c')
-rw-r--r--src/core/ngx_cycle.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 243febd0e..f900a2824 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -54,11 +54,8 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
ngx_list_part_t *part, *opart;
ngx_open_file_t *file;
ngx_listening_t *ls, *nls;
- ngx_core_conf_t *ccf;
+ ngx_core_conf_t *ccf, *old_ccf;
ngx_core_module_t *module;
-#if !(WIN32)
- ngx_core_conf_t *old_ccf;
-#endif
log = old_cycle->log;
@@ -747,6 +744,14 @@ old_shm_zone_done:
failed:
+ if (!ngx_is_init_cycle(old_cycle)) {
+ old_ccf = (ngx_core_conf_t *) ngx_get_conf(old_cycle->conf_ctx,
+ ngx_core_module);
+ if (old_ccf->environment) {
+ environ = old_ccf->environment;
+ }
+ }
+
/* rollback the new cycle configuration */
part = &cycle->open_files.part;