# HG changeset patch # User Igor Sysoev # Date 1166983986 0 # Node ID d1d8cde9aab90c0d6b91705445374d2273d4c455 # Parent 12077affd903a59c7f84616571f603411380b3c4 worker_rlimit_core supports size in K, M, and G diff --git a/src/core/nginx.c b/src/core/nginx.c --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -109,7 +109,7 @@ static ngx_command_t ngx_core_commands[ { ngx_string("worker_rlimit_core"), NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, - ngx_conf_set_num_slot, + ngx_conf_set_size_slot, 0, offsetof(ngx_core_conf_t, rlimit_core), NULL }, @@ -620,7 +620,7 @@ ngx_core_module_create_conf(ngx_cycle_t ccf->debug_points = NGX_CONF_UNSET; ccf->rlimit_nofile = NGX_CONF_UNSET; - ccf->rlimit_core = NGX_CONF_UNSET; + ccf->rlimit_core = NGX_CONF_UNSET_SIZE; ccf->rlimit_sigpending = NGX_CONF_UNSET; ccf->user = (ngx_uid_t) NGX_CONF_UNSET_UINT; diff --git a/src/core/ngx_cycle.h b/src/core/ngx_cycle.h --- a/src/core/ngx_cycle.h +++ b/src/core/ngx_cycle.h @@ -68,8 +68,8 @@ typedef struct { ngx_int_t debug_points; ngx_int_t rlimit_nofile; - ngx_int_t rlimit_core; ngx_int_t rlimit_sigpending; + size_t rlimit_core; int priority; diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -787,7 +787,7 @@ ngx_worker_process_init(ngx_cycle_t *cyc } } - if (ccf->rlimit_core != NGX_CONF_UNSET) { + if (ccf->rlimit_core != NGX_CONF_UNSET_SIZE) { rlmt.rlim_cur = (rlim_t) ccf->rlimit_core; rlmt.rlim_max = (rlim_t) ccf->rlimit_core;