From: Josh Date: Wed, 24 Sep 2014 16:44:58 +0000 (-0400) Subject: fixing cpu affinity for non-linux X-Git-Tag: 3.0.0-233~1397^2~24^2~11^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fa41455090b82c60e5e925b64e422102ef2050b;p=thirdparty%2Fsnort3.git fixing cpu affinity for non-linux --- diff --git a/src/main/modules.cc b/src/main/modules.cc index 180cf6509..7a3723c7d 100644 --- a/src/main/modules.cc +++ b/src/main/modules.cc @@ -1275,9 +1275,6 @@ bool ProcessModule::end(const char* fqn, int idx, SnortConfig* sc) ParseError("%s - cpu must be an integer in the range" " of 0 < cpu < max_cpus", fqn, cpu); - else if (cpu >= CPU_SETSIZE) - ParseError("cpu must be between 0 and %d", INT8_MAX); - else if ((source.empty()) && (thread == -1)) ParseError("%s - must have either a source or a thread!", fqn); diff --git a/src/main/thread.cc b/src/main/thread.cc index 5657e29e4..5710729cc 100644 --- a/src/main/thread.cc +++ b/src/main/thread.cc @@ -47,8 +47,6 @@ static unsigned instance_max = 1; static THREAD_LOCAL unsigned instance_id = 0; -static THREAD_LOCAL cpu_set_t cpu_set; - void set_instance_id(unsigned id) { @@ -134,6 +132,8 @@ void pin_thread_to_cpu(const char* source) // PREPROCESSOR MACROS -- these are not actually if statements! # if LINUX { + static THREAD_LOCAL cpu_set_t cpu_set; + if (cpu >= CPU_SETSIZE) FatalError("Maximum CPU value for this Operating System is %d", CPU_SETSIZE);