diff options
author | Igor Sysoev <igor@sysoev.ru> | 2010-05-14 09:56:37 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2010-05-14 09:56:37 +0000 |
commit | 05b1a8f1e3595beab4397e25c2a6db9d832a6a97 (patch) | |
tree | 282923e87cbaf9d634dab4a7c69ce85d602effcf /src/core/nginx.c | |
parent | 328df7a5cc91180fef3b1b58129e14bc79bef80b (diff) | |
download | nginx-05b1a8f1e3595beab4397e25c2a6db9d832a6a97.tar.gz nginx-05b1a8f1e3595beab4397e25c2a6db9d832a6a97.zip |
ngx_str_set() and ngx_str_null()
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r-- | src/core/nginx.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index a5fbccd40..80a5d18ae 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -859,14 +859,11 @@ ngx_process_options(ngx_cycle_t *cycle) #else #ifdef NGX_CONF_PREFIX - cycle->conf_prefix.len = sizeof(NGX_CONF_PREFIX) - 1; - cycle->conf_prefix.data = (u_char *) NGX_CONF_PREFIX; + ngx_str_set(&cycle->conf_prefix, NGX_CONF_PREFIX); #else - cycle->conf_prefix.len = sizeof(NGX_PREFIX) - 1; - cycle->conf_prefix.data = (u_char *) NGX_PREFIX; + ngx_str_set(&cycle->conf_prefix, NGX_PREFIX); #endif - cycle->prefix.len = sizeof(NGX_PREFIX) - 1; - cycle->prefix.data = (u_char *) NGX_PREFIX; + ngx_str_set(&cycle->prefix, NGX_PREFIX); #endif } @@ -876,8 +873,7 @@ ngx_process_options(ngx_cycle_t *cycle) cycle->conf_file.data = ngx_conf_file; } else { - cycle->conf_file.len = sizeof(NGX_CONF_PATH) - 1; - cycle->conf_file.data = (u_char *) NGX_CONF_PATH; + ngx_str_set(&cycle->conf_file, NGX_CONF_PATH); } if (ngx_conf_full_name(cycle, &cycle->conf_file, 0) != NGX_OK) { @@ -993,8 +989,7 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf) if (ccf->pid.len == 0) { - ccf->pid.len = sizeof(NGX_PID_PATH) - 1; - ccf->pid.data = (u_char *) NGX_PID_PATH; + ngx_str_set(&ccf->pid, NGX_PID_PATH); } if (ngx_conf_full_name(cycle, &ccf->pid, 0) != NGX_OK) { @@ -1042,8 +1037,7 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf) if (ccf->lock_file.len == 0) { - ccf->lock_file.len = sizeof(NGX_LOCK_PATH) - 1; - ccf->lock_file.data = (u_char *) NGX_LOCK_PATH; + ngx_str_set(&ccf->lock_file, NGX_LOCK_PATH); } if (ngx_conf_full_name(cycle, &ccf->lock_file, 0) != NGX_OK) { |