]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
filestore (old): register global stat in init func
authorJason Ish <ish@unx.ca>
Fri, 12 Jan 2018 20:43:01 +0000 (14:43 -0600)
committerJason Ish <ish@unx.ca>
Thu, 18 Jan 2018 13:26:29 +0000 (07:26 -0600)
This doesn't need to be registered from suricata.c. And moving
it to the init function makes sure its only registered if
the logger is actually enabled.

src/log-filestore.c
src/suricata.c

index 39eb7dfdeaf283264c1962a8d7d766387f87f515..69b4a42de715a960a7bbe20cb9023c8b5dbbbe20 100644 (file)
@@ -670,18 +670,14 @@ static OutputInitResult LogFilestoreLogInitCtx(ConfNode *conf)
         SCLogInfo("enabling pid as a part of all file names");
     }
 
+    StatsRegisterGlobalCounter("file_store.open_files",
+            LogFilestoreOpenFilesCounter);
+
     result.ctx = output_ctx;
     result.ok = true;
     SCReturnCT(result, "OutputInitResult");
 }
 
-
-void LogFilestoreInitConfig(void)
-{
-    StatsRegisterGlobalCounter("file_store.open_files", LogFilestoreOpenFilesCounter);
-}
-
-
 void LogFilestoreRegister (void)
 {
     OutputRegisterFiledataModule(LOGGER_FILE_STORE, MODULE_NAME, "file",
index 120b5fc2a40cb1ddce31f228ebe6e1238ec0220b..abeda7feafe73ec30fd718fc07aa38fda7d3d8ab 100644 (file)
 #include "host-storage.h"
 
 #include "util-lua.h"
-#include "log-filestore.h"
 
 #ifdef HAVE_RUST
 #include "rust.h"
@@ -2206,7 +2205,6 @@ void PreRunInit(const int runmode)
     DefragInit();
     FlowInitConfig(FLOW_QUIET);
     IPPairInitConfig(FLOW_QUIET);
-    LogFilestoreInitConfig();
     StreamTcpInitConfig(STREAM_VERBOSE);
     AppLayerParserPostStreamSetup();
     AppLayerRegisterGlobalCounters();