summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nginx/src/core/nginx.c
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2012-11-14 21:35:00 +0000
committerrobert <robert@openbsd.org>2012-11-14 21:35:00 +0000
commit42bdae40dcaec1c21a23c24121dbdd98a26ba542 (patch)
treef419dc7c2442b03afd9dd3e4c0ceaf685aa1849c /usr.sbin/nginx/src/core/nginx.c
parentDo not bother reloading r1 from the stack in the epilogue, if it has not been (diff)
downloadwireguard-openbsd-42bdae40dcaec1c21a23c24121dbdd98a26ba542.tar.xz
wireguard-openbsd-42bdae40dcaec1c21a23c24121dbdd98a26ba542.zip
update to 1.2.5
Diffstat (limited to 'usr.sbin/nginx/src/core/nginx.c')
-rw-r--r--usr.sbin/nginx/src/core/nginx.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/usr.sbin/nginx/src/core/nginx.c b/usr.sbin/nginx/src/core/nginx.c
index 0fb0202d93f..2fc6fd53750 100644
--- a/usr.sbin/nginx/src/core/nginx.c
+++ b/usr.sbin/nginx/src/core/nginx.c
@@ -21,6 +21,8 @@ static char *ngx_set_env(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static char *ngx_set_priority(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static char *ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
+static char *ngx_set_worker_processes(ngx_conf_t *cf, ngx_command_t *cmd,
+ void *conf);
static ngx_conf_enum_t ngx_debug_points[] = {
@@ -69,9 +71,9 @@ static ngx_command_t ngx_core_commands[] = {
{ ngx_string("worker_processes"),
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
+ ngx_set_worker_processes,
+ 0,
0,
- offsetof(ngx_core_conf_t, worker_processes),
NULL },
{ ngx_string("debug_points"),
@@ -1335,3 +1337,32 @@ ngx_get_cpu_affinity(ngx_uint_t n)
return ccf->cpu_affinity[ccf->cpu_affinity_n - 1];
}
+
+
+static char *
+ngx_set_worker_processes(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+{
+ ngx_str_t *value;
+ ngx_core_conf_t *ccf;
+
+ ccf = (ngx_core_conf_t *) conf;
+
+ if (ccf->worker_processes != NGX_CONF_UNSET) {
+ return "is duplicate";
+ }
+
+ value = (ngx_str_t *) cf->args->elts;
+
+ if (ngx_strcmp(value[1].data, "auto") == 0) {
+ ccf->worker_processes = ngx_ncpu;
+ return NGX_CONF_OK;
+ }
+
+ ccf->worker_processes = ngx_atoi(value[1].data, value[1].len);
+
+ if (ccf->worker_processes == NGX_ERROR) {
+ return "invalid value";
+ }
+
+ return NGX_CONF_OK;
+}