Mercurial > hg > nginx
comparison src/core/ngx_cycle.c @ 6821:30b6f1ff192b
Perl: removed special environment handling for the perl module.
In Perl 5.8.6 the default was switched to use putenv() when used as
embedded library unless "PL_use_safe_putenv = 0" is explicitly used
in the code. Therefore, for modern versions of Perl it is no longer
necessary to restore previous environment when calling perl_destruct().
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 07 Dec 2016 19:03:26 +0300 |
parents | 1bf4f21b1b72 |
children | 97c99bb43737 |
comparison
equal
deleted
inserted
replaced
6820:eada22643e8b | 6821:30b6f1ff192b |
---|---|
35 | 35 |
36 ngx_cycle_t * | 36 ngx_cycle_t * |
37 ngx_init_cycle(ngx_cycle_t *old_cycle) | 37 ngx_init_cycle(ngx_cycle_t *old_cycle) |
38 { | 38 { |
39 void *rv; | 39 void *rv; |
40 char **senv, **env; | 40 char **senv; |
41 ngx_uint_t i, n; | 41 ngx_uint_t i, n; |
42 ngx_log_t *log; | 42 ngx_log_t *log; |
43 ngx_time_t *tp; | 43 ngx_time_t *tp; |
44 ngx_conf_t conf; | 44 ngx_conf_t conf; |
45 ngx_pool_t *pool; | 45 ngx_pool_t *pool; |
748 | 748 |
749 ngx_destroy_pool(conf.temp_pool); | 749 ngx_destroy_pool(conf.temp_pool); |
750 | 750 |
751 if (ngx_process == NGX_PROCESS_MASTER || ngx_is_init_cycle(old_cycle)) { | 751 if (ngx_process == NGX_PROCESS_MASTER || ngx_is_init_cycle(old_cycle)) { |
752 | 752 |
753 /* | |
754 * perl_destruct() frees environ, if it is not the same as it was at | |
755 * perl_construct() time, therefore we save the previous cycle | |
756 * environment before ngx_conf_parse() where it will be changed. | |
757 */ | |
758 | |
759 env = environ; | |
760 environ = senv; | |
761 | |
762 ngx_destroy_pool(old_cycle->pool); | 753 ngx_destroy_pool(old_cycle->pool); |
763 cycle->old_cycle = NULL; | 754 cycle->old_cycle = NULL; |
764 | |
765 environ = env; | |
766 | 755 |
767 return cycle; | 756 return cycle; |
768 } | 757 } |
769 | 758 |
770 | 759 |