summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_cycle.c
diff options
context:
space:
mode:
authorIgor Ippolitov <iippolitov@nginx.com>2020-11-19 16:59:00 +0000
committerIgor Ippolitov <iippolitov@nginx.com>2020-11-19 16:59:00 +0000
commit7e1637a31631955aec753365c7149c64b216d47e (patch)
tree6472e10441473f30e95bd0b64a39b2335e308699 /src/core/ngx_cycle.c
parent23597e97f52316ef024796c5f1b5ca0d70ecff31 (diff)
downloadnginx-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.c9
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) {