diff options
| author | Igor Ippolitov <iippolitov@nginx.com> | 2020-11-19 16:59:00 +0000 |
|---|---|---|
| committer | Igor Ippolitov <iippolitov@nginx.com> | 2020-11-19 16:59:00 +0000 |
| commit | 7e1637a31631955aec753365c7149c64b216d47e (patch) | |
| tree | 6472e10441473f30e95bd0b64a39b2335e308699 /src/core/ngx_cycle.c | |
| parent | 23597e97f52316ef024796c5f1b5ca0d70ecff31 (diff) | |
| download | nginx-7e1637a31631955aec753365c7149c64b216d47e.tar.gz nginx-7e1637a31631955aec753365c7149c64b216d47e.tar.bz2 | |
Core: "-e" command line option.
When installing or running from a non-root user it is sometimes required to
override default, compiled in error log path. There was no way to do this
without rebuilding the binary (ticket #147).
This patch introduced "-e" command line option which allows one to override
compiled in error log path.
Diffstat (limited to 'src/core/ngx_cycle.c')
| -rw-r--r-- | src/core/ngx_cycle.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index d7479fa41..6978c3e43 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -96,6 +96,15 @@ ngx_init_cycle(ngx_cycle_t *old_cycle) return NULL; } + cycle->error_log.len = old_cycle->error_log.len; + cycle->error_log.data = ngx_pnalloc(pool, old_cycle->error_log.len + 1); + if (cycle->error_log.data == NULL) { + ngx_destroy_pool(pool); + return NULL; + } + ngx_cpystrn(cycle->error_log.data, old_cycle->error_log.data, + old_cycle->error_log.len + 1); + cycle->conf_file.len = old_cycle->conf_file.len; cycle->conf_file.data = ngx_pnalloc(pool, old_cycle->conf_file.len + 1); if (cycle->conf_file.data == NULL) { |
