]> git.kaiwu.me - nginx.git/commitdiff
worker_rlimit_core supports size in K, M, and G
authorIgor Sysoev <igor@sysoev.ru>
Sun, 24 Dec 2006 18:13:06 +0000 (18:13 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sun, 24 Dec 2006 18:13:06 +0000 (18:13 +0000)
src/core/nginx.c
src/core/ngx_cycle.h
src/os/unix/ngx_process_cycle.c

index 26ed69eabf4aaf3c2677c3be70c7a68e1720c45c..47dafe141cc88ac45c66623a67406dc6c29b7546 100644 (file)
@@ -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 *cycle)
     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;
index e1a35eb75e5208d12d6e4ff0d8b359bda8162ed1..677132ee1fac91a0bb82dba78f36ddad79302602 100644 (file)
@@ -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;
 
index a262ba5eb7e59fec75cfd4bbce1118a4c4c4b1c6..da4828f88eba078c78028677d8e66ae19e4266dc 100644 (file)
@@ -787,7 +787,7 @@ ngx_worker_process_init(ngx_cycle_t *cycle, ngx_uint_t priority)
             }
         }
 
-        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;