]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4926: main: add message when unable to set affinity
authorMichael Matirko (mmatirko) <mmatirko@cisco.com>
Thu, 2 Oct 2025 19:04:14 +0000 (19:04 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Thu, 2 Oct 2025 19:04:14 +0000 (19:04 +0000)
Merge in SNORT/snort3 from ~MMATIRKO/snort3:proc_error_msg to master

Squashed commit of the following:

commit 21b3ff6037338932101226b997dd65220ace78cf
Author: Michael Matirko <mmatirko@cisco.com>
Date:   Tue Sep 30 10:33:59 2025 -0400

    main: add message when unable to set affinity

src/main/thread_config.cc

index b04f5349533066a7e9f2b955ff3ba1113e4b68a6..cf2301a2c8cfd9d47edc64cc36913af1adc816b5 100644 (file)
@@ -112,6 +112,14 @@ CpuSet* ThreadConfig::validate_cpuset_string(const char* cpuset_str)
     if (hwloc_bitmap_list_sscanf(cpuset, cpuset_str) ||
             !hwloc_bitmap_isincluded(cpuset, process_cpuset))
     {
+        char* allowed_s = nullptr;
+        hwloc_bitmap_list_asprintf(&allowed_s, process_cpuset);
+        ParseError("Invalid CPU set '%s'. Allowed process CPU set: %s\n",
+            cpuset_str ? cpuset_str : "(null)", allowed_s ? allowed_s : "(null)");
+
+        if (allowed_s)
+            free(allowed_s);
+
         hwloc_bitmap_free(cpuset);
         return nullptr;
     }