suricata: remove instance from ParseCommandLine

We want to be able to call ParseCommandLine from library users, but
currently library users don't have access to the `suricata` instance
type. Since this var is used other places as a global, use the global
one in ParseCommandLine as well.

Not ideal, but isolating SCInstance to a non-global will be another
challenge on its own.
pull/10720/head
Jason Ish 1 year ago committed by Victor Julien
parent db44740fd8
commit 04bd026c5b

@ -1312,8 +1312,9 @@ static bool IsLogDirectoryWritable(const char* str)
extern int g_skip_prefilter;
static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
static TmEcode ParseCommandLine(int argc, char **argv)
{
SCInstance *suri = &suricata;
int opt;
int dump_config = 0;
@ -2899,7 +2900,7 @@ void SuricataPreInit(const char *progname)
void SuricataInit(int argc, char **argv)
{
if (ParseCommandLine(argc, argv, &suricata) != TM_ECODE_OK) {
if (ParseCommandLine(argc, argv) != TM_ECODE_OK) {
exit(EXIT_FAILURE);
}

Loading…
Cancel
Save