]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Running mode is set earlier so out earlier
authorEric Leblond <eric@regit.org>
Tue, 7 May 2013 12:20:33 +0000 (14:20 +0200)
committerEric Leblond <eric@regit.org>
Tue, 30 Jul 2013 13:22:33 +0000 (15:22 +0200)
src/suricata.c

index a81ca5edbf340774e91d0cadae1e9f542787f248..1c3de056c0bc9c7b66522914532f343e4995c559 100644 (file)
@@ -1580,6 +1580,11 @@ int main(int argc, char **argv)
 
     /* Set the global run mode */
     run_mode = suri.run_mode;
+    /* run_mode should be set here */
+    if (suri.run_mode == RUNMODE_UNKNOWN) {
+        usage(argv[0]);
+        exit(EXIT_FAILURE);
+    }
 
     if (suri.run_mode == RUNMODE_UNITTEST)
         return SuriRunUnittests(0, suri.regex_arg);
@@ -1702,11 +1707,6 @@ int main(int argc, char **argv)
         DefragInit();
     }
 
-    if (suri.run_mode == RUNMODE_UNKNOWN) {
-        usage(argv[0]);
-        exit(EXIT_FAILURE);
-    }
-
     if (suri.run_mode == RUNMODE_ENGINE_ANALYSIS) {
         SCLogInfo("== Carrying out Engine Analysis ==");
         char *temp = NULL;