]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4408: control: cleanup code
authorOleksandr Stepanov -X (ostepano - SOFTSERVE INC at Cisco) <ostepano@cisco.com>
Tue, 6 Aug 2024 19:17:01 +0000 (19:17 +0000)
committerChris Sherwin (chsherwi) <chsherwi@cisco.com>
Tue, 6 Aug 2024 19:17:01 +0000 (19:17 +0000)
Merge in SNORT/snort3 from ~OSTEPANO/snort3:cleanup_control to master

Squashed commit of the following:

commit dcccfa9baccc02c0efa32e7592834457d6e9f1a1
Author: Oleksandr Stepanov <ostepano@cisco.com>
Date:   Fri Aug 2 06:28:22 2024 -0400

    control: Code cleanup

src/main.cc

index 690f95b2246326ce32f0da65e44196143358f73b..d6928f46b34890ad010adce50f217ec40d422d14 100644 (file)
@@ -1142,10 +1142,11 @@ static void main_loop()
 
             pthreads_started = pigs_started_count && num_threads <= pigs_started_count + pigs_failed;
             
-#ifdef REG_TEST
             if (pthreads_started)
             {
+#ifdef REG_TEST
                 LogMessage("All pthreads started\n");
+#endif
 
 #ifdef SHELL
                 if (use_shell(SnortConfig::get_conf()))
@@ -1155,11 +1156,9 @@ static void main_loop()
                 }
 #endif
             }
-#endif
         }
 
-#ifdef SHELL
-        if(!pthreads_running)
+        if (!pthreads_running)
         {
             const unsigned num_threads = (!Trough::has_next()) ? max_swine : max_pigs;
             unsigned pigs_running_count = 0;
@@ -1172,7 +1171,6 @@ static void main_loop()
 
             pthreads_running = pigs_running_count && num_threads <= pigs_running_count + pigs_failed;
         }
-#endif
 
         if ( !exit_requested and (swine < max_pigs) and (src = Trough::get_next()) )
         {