From: Anoop Saldanha Date: Sat, 7 Jul 2012 16:39:06 +0000 (+0530) Subject: Set thread name Suricata-Main for main thread and LiveRuleSwap for live swap thread X-Git-Tag: suricata-1.3.1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2f589527ac22ceacafb0c3ecc98263ff5b43947;p=thirdparty%2Fsuricata.git Set thread name Suricata-Main for main thread and LiveRuleSwap for live swap thread --- diff --git a/src/detect-engine.c b/src/detect-engine.c index 422a5aed61..665ae35420 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -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; diff --git a/src/suricata.c b/src/suricata.c index f3207c896b..29e715c1af 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -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