]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixing cpu affinity for non-linux
authorJosh <jrosenba@cisco.com>
Wed, 24 Sep 2014 16:44:58 +0000 (12:44 -0400)
committerJosh <jrosenba@cisco.com>
Wed, 24 Sep 2014 16:44:58 +0000 (12:44 -0400)
src/main/modules.cc
src/main/thread.cc

index 180cf65091049630be376f0923299a0259d58a6b..7a3723c7d2b4caaf251d4c12be7df57de4973c29 100644 (file)
@@ -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);
 
index 5657e29e4e9a46ae76358dbaec1e4dcb07edbabb..5710729ccd4aa633444e2ddffeb636e024a0a819 100644 (file)
@@ -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);