-p and --prefix=
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 0c0fd8a..10d0771 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -34,11 +34,7 @@
static ngx_connection_t dumb;
/* STUB */
-#ifdef NGX_ERROR_LOG_PATH
static ngx_str_t error_log = ngx_string(NGX_ERROR_LOG_PATH);
-#else
-static ngx_str_t error_log = ngx_null_string;
-#endif
ngx_cycle_t *
@@ -87,9 +83,20 @@
cycle->pool = pool;
cycle->log = log;
cycle->old_cycle = old_cycle;
- cycle->root.len = sizeof(NGX_PREFIX) - 1;
- cycle->root.data = (u_char *) NGX_PREFIX;
+ cycle->conf_prefix.len = old_cycle->conf_prefix.len;
+ cycle->conf_prefix.data = ngx_pstrdup(pool, &old_cycle->conf_prefix);
+ if (cycle->conf_prefix.data == NULL) {
+ ngx_destroy_pool(pool);
+ return NULL;
+ }
+
+ cycle->prefix.len = old_cycle->prefix.len;
+ cycle->prefix.data = ngx_pstrdup(pool, &old_cycle->prefix);
+ if (cycle->prefix.data == NULL) {
+ ngx_destroy_pool(pool);
+ return NULL;
+ }
cycle->conf_file.len = old_cycle->conf_file.len;
cycle->conf_file.data = ngx_pnalloc(pool, old_cycle->conf_file.len + 1);
@@ -100,15 +107,12 @@
ngx_cpystrn(cycle->conf_file.data, old_cycle->conf_file.data,
old_cycle->conf_file.len + 1);
-
cycle->conf_param.len = old_cycle->conf_param.len;
- cycle->conf_param.data = ngx_pnalloc(pool, old_cycle->conf_param.len);
+ cycle->conf_param.data = ngx_pstrdup(pool, &old_cycle->conf_param);
if (cycle->conf_param.data == NULL) {
ngx_destroy_pool(pool);
return NULL;
}
- ngx_memcpy(cycle->conf_param.data, old_cycle->conf_param.data,
- old_cycle->conf_param.len);
n = old_cycle->pathes.nelts ? old_cycle->pathes.nelts : 10;
@@ -162,14 +166,12 @@
}
- cycle->new_log = ngx_log_create_errlog(cycle, NULL);
+ cycle->new_log = ngx_log_create_errlog(cycle, &error_log);
if (cycle->new_log == NULL) {
ngx_destroy_pool(pool);
return NULL;
}
- cycle->new_log->file->name = error_log;
-
n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10;
@@ -350,7 +352,7 @@
i = 0;
}
- if (file[i].name.data == NULL) {
+ if (file[i].name.len == 0) {
continue;
}
@@ -1083,7 +1085,7 @@
i = 0;
}
- if (file[i].name.data == NULL) {
+ if (file[i].name.len == 0) {
continue;
}