From: Jason Ish Date: Fri, 12 Jan 2018 20:43:01 +0000 (-0600) Subject: filestore (old): register global stat in init func X-Git-Tag: suricata-4.1.0-beta1~335 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc35a5b81ffde8cdb15d2ada7aea96587a853462;p=thirdparty%2Fsuricata.git filestore (old): register global stat in init func 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. --- diff --git a/src/log-filestore.c b/src/log-filestore.c index 39eb7dfdea..69b4a42de7 100644 --- a/src/log-filestore.c +++ b/src/log-filestore.c @@ -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", diff --git a/src/suricata.c b/src/suricata.c index 120b5fc2a4..abeda7feaf 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -167,7 +167,6 @@ #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();