From 4a4600539db9394f19d8cd9cc62b9d1b9bfa2aaa Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Thu, 3 Oct 2013 13:50:09 +0200 Subject: [PATCH] suricata: info message after log init This patch moves version display after log init so we can have an homogeneous display. --- src/suricata.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/suricata.c b/src/suricata.c index 1c86ca17ac..c3ae657106 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -918,6 +918,18 @@ static TmEcode PrintVersion() return TM_ECODE_OK; } +static TmEcode SCPrintVersion() +{ +#ifdef REVISION + SCLogNotice("This is %s version %s (rev %s)", PROG_NAME, PROG_VER, xstr(REVISION)); +#elif defined RELEASE + SCLogNotice("This is %s version %s RELEASE", PROG_NAME, PROG_VER); +#else + SCLogNotice("This is %s version %s", PROG_NAME, PROG_VER); +#endif + return TM_ECODE_OK; +} + static void SCSetStartTime(SCInstance *suri) { memset(&suri->start_time, 0, sizeof(suri->start_time)); @@ -1856,10 +1868,6 @@ int main(int argc, char **argv) if (suri.run_mode == RUNMODE_UNITTEST) return RunUnittests(0, suri.regex_arg); - PrintVersion(); - - UtilCpuPrintSummary(); - #ifdef __SC_CUDA_SUPPORT__ /* Init the CUDA environment */ SCCudaInitCudaEnvironment(); @@ -1888,6 +1896,10 @@ int main(int argc, char **argv) * logging module. */ SCLogLoadConfig(suri.daemon); + SCPrintVersion(); + + UtilCpuPrintSummary(); + /* load the pattern matchers */ MpmTableSetup(); #ifdef __SC_CUDA_SUPPORT__