Skip to content

Commit a38a9c0

Browse files
committed
update
1 parent f67cff8 commit a38a9c0

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

auto/unix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ ngx_feature_test="cpu_set_t mask;
312312
. auto/feature
313313

314314
ngx_feature="sched_getaffinity()"
315-
ngx_feature_name="NGX_HAVE_SCHED_GETAFFINITY"
315+
ngx_feature_name="T_NGX_HAVE_SCHED_GETAFFINITY"
316316
ngx_feature_run=no
317317
ngx_feature_incs="#include <sched.h>"
318318
ngx_feature_path=

src/core/nginx.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,8 +1462,8 @@ ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
14621462

14631463
n = 2;
14641464

1465-
#if (NGX_HAVE_SCHED_GETAFFINITY)
1466-
} elseif (ngx_strcmp(value[1].data, "auto_online_cpu") == 0) {
1465+
#if (T_NGX_HAVE_SCHED_GETAFFINITY)
1466+
} else if (ngx_strcmp(value[1].data, "auto_online_cpu") == 0) {
14671467

14681468
if (cf->args->nelts > 3) {
14691469
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -1495,7 +1495,7 @@ ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
14951495
return NGX_CONF_ERROR;
14961496
}
14971497

1498-
#if (NGX_HAVE_SCHED_GETAFFINITY)
1498+
#if (T_NGX_HAVE_SCHED_GETAFFINITY)
14991499
if (ccf->cpu_affinity_auto == 2) {
15001500
continue;
15011501
}
@@ -1551,7 +1551,7 @@ ngx_get_cpu_affinity(ngx_uint_t n)
15511551
ngx_cpuset_t *mask;
15521552
ngx_core_conf_t *ccf;
15531553

1554-
#if (NGX_HAVE_SCHED_GETAFFINITY)
1554+
#if (T_NGX_HAVE_SCHED_GETAFFINITY)
15551555
ngx_int_t worker_i, machine_core, all_machine_cores;
15561556
#endif
15571557

@@ -1567,7 +1567,7 @@ ngx_get_cpu_affinity(ngx_uint_t n)
15671567
if (ccf->cpu_affinity_auto) {
15681568
mask = &ccf->cpu_affinity[ccf->cpu_affinity_n - 1];
15691569

1570-
#if (NGX_HAVE_SCHED_GETAFFINITY && NGX_HAVE_SC_NPROCESSORS_ONLN)
1570+
#if (T_NGX_HAVE_SCHED_GETAFFINITY && NGX_HAVE_SC_NPROCESSORS_ONLN && NGX_HAVE_SC_NPROCESSORS_CONF)
15711571
if (ccf->cpu_affinity_auto == 2) {
15721572
all_machine_cores = sysconf(_SC_NPROCESSORS_CONF);
15731573

src/os/unix/ngx_getaffinity.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
/*
3-
* Copyright (C) Nginx, Inc.
3+
* Copyright (C) lhanjian (lhjay1@gmail.com)
44
*/
55

66

77
#include <ngx_config.h>
88
#include <ngx_core.h>
99

1010

11-
#if (NGX_HAVE_SCHED_GETAFFINITY)
11+
#if (T_NGX_HAVE_SCHED_GETAFFINITY)
1212

1313
void
1414
ngx_getaffinity(ngx_cpuset_t *cpu_affinity, ngx_log_t *log)

src/os/unix/ngx_getaffinity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* Copyright (C) Nginx, Inc.
3+
* Copyright (C) lhanjian (lhjay1@gmail.com)
44
*/
55

66
#ifndef _NGX_SETAFFINITY_H_INCLUDED_

0 commit comments

Comments
 (0)