comparison src/core/ngx_cycle.c @ 3142:959fa3a11b03

restore environ, this fixes segfault on reconfiguration failure when perl module creates new environment
author Igor Sysoev <igor@sysoev.ru>
date Fri, 18 Sep 2009 09:21:14 +0000
parents cbee9c114504
children a4f264c43173
comparison
equal deleted inserted replaced
3141:cbee9c114504 3142:959fa3a11b03
253 #if 0 253 #if 0
254 log->log_level = NGX_LOG_DEBUG_ALL; 254 log->log_level = NGX_LOG_DEBUG_ALL;
255 #endif 255 #endif
256 256
257 if (ngx_conf_param(&conf) != NGX_CONF_OK) { 257 if (ngx_conf_param(&conf) != NGX_CONF_OK) {
258 environ = senv;
258 ngx_destroy_cycle_pools(&conf); 259 ngx_destroy_cycle_pools(&conf);
259 return NULL; 260 return NULL;
260 } 261 }
261 262
262 if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) { 263 if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) {
264 environ = senv;
263 ngx_destroy_cycle_pools(&conf); 265 ngx_destroy_cycle_pools(&conf);
264 return NULL; 266 return NULL;
265 } 267 }
266 268
267 if (ngx_test_config) { 269 if (ngx_test_config) {
278 280
279 if (module->init_conf) { 281 if (module->init_conf) {
280 if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index]) 282 if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index])
281 == NGX_CONF_ERROR) 283 == NGX_CONF_ERROR)
282 { 284 {
285 environ = senv;
283 ngx_destroy_cycle_pools(&conf); 286 ngx_destroy_cycle_pools(&conf);
284 return NULL; 287 return NULL;
285 } 288 }
286 } 289 }
287 } 290 }