]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Set thread name Suricata-Main for main thread and LiveRuleSwap for live swap thread
authorAnoop Saldanha <poonaatsoc@gmail.com>
Sat, 7 Jul 2012 16:39:06 +0000 (22:09 +0530)
committerVictor Julien <victor@inliniac.net>
Wed, 11 Jul 2012 11:13:20 +0000 (13:13 +0200)
src/detect-engine.c
src/suricata.c

index 422a5aed6138ea66975b31856637b1dbcda81130..665ae35420298fb81720086a35b39b9b89df92a6 100644 (file)
@@ -77,6 +77,10 @@ static void *DetectEngineLiveRuleSwap(void *arg)
 {
     SCEnter();
 
+    if (SCSetThreadName("LiveRuleSwap") < 0) {
+        SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
+    }
+
     SCLogInfo("===== Starting live rule swap triggered by user signal USR2 =====");
 
     ThreadVars *tv_local = (ThreadVars *)arg;
index f3207c896bf244400b80f8c45cc5ae9bd3184095..29e715c1af518b16398e2e83a04f07b332f04307 100644 (file)
@@ -700,6 +700,10 @@ int main(int argc, char **argv)
     /* initialize the logging subsys */
     SCLogInitLogModule(NULL);
 
+    if (SCSetThreadName("Suricata-Main") < 0) {
+        SCLogWarning(SC_ERR_THREAD_INIT, "Unable to set thread name");
+    }
+
     RunModeRegisterRunModes();
 
     /* By default use IDS mode, but if nfq or ipfw