diff options
author | João Valverde <j@v6e.pt> | 2021-06-24 21:20:25 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2021-06-26 00:18:26 +0100 |
commit | c6a920686ce59ea8b29f7a61f8197077baedf304 (patch) | |
tree | da6268c7e6fce9e38f99190f08fe3c08b5301b38 /extcap | |
parent | c2c256f0d8afa76599d7c3f3dcfac23c02069209 (diff) |
wslog: Check environment initialization for errors
Initialiaze the cmdarg error stream earlier.
Dumpcap also needs to know earlier if it is running in capture
child mode.
Diffstat (limited to 'extcap')
-rw-r--r-- | extcap/androiddump.c | 6 | ||||
-rw-r--r-- | extcap/ciscodump.c | 5 | ||||
-rw-r--r-- | extcap/dpauxmon.c | 3 | ||||
-rw-r--r-- | extcap/etwdump.c | 3 | ||||
-rw-r--r-- | extcap/randpktdump.c | 6 | ||||
-rw-r--r-- | extcap/sdjournal.c | 3 | ||||
-rw-r--r-- | extcap/sshdump.c | 3 | ||||
-rw-r--r-- | extcap/udpdump.c | 3 |
8 files changed, 25 insertions, 7 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c index 7cf52e452f..7a08db63d3 100644 --- a/extcap/androiddump.c +++ b/extcap/androiddump.c @@ -2528,13 +2528,13 @@ int main(int argc, char *argv[]) { char *help_url; char *help_header = NULL; + cmdarg_err_init(androiddump_cmdarg_err, androiddump_cmdarg_err); + /* Initialize log handler early so we can have proper logging during startup. */ ws_log_init("androiddump", NULL); - cmdarg_err_init(androiddump_cmdarg_err, androiddump_cmdarg_err); - /* Early logging command-line initialization. */ - ws_log_parse_args(&argc, argv, vcmdarg_err, EXIT_FAILURE); + ws_log_parse_args(&argc, argv, NULL, LOG_ARGS_NOEXIT); /* * Get credential information for later use. diff --git a/extcap/ciscodump.c b/extcap/ciscodump.c index 217fd838d8..499563332d 100644 --- a/extcap/ciscodump.c +++ b/extcap/ciscodump.c @@ -536,7 +536,10 @@ int main(int argc, char *argv[]) /* Initialize log handler early so we can have proper logging during startup. */ ws_log_init("ciscodump", NULL); - + + /* Early logging command-line initialization. */ + ws_log_parse_args(&argc, argv, NULL, LOG_ARGS_NOEXIT); + /* * Get credential information for later use. */ diff --git a/extcap/dpauxmon.c b/extcap/dpauxmon.c index 98c6b1319d..7e86a75299 100644 --- a/extcap/dpauxmon.c +++ b/extcap/dpauxmon.c @@ -492,6 +492,9 @@ int main(int argc, char *argv[]) /* Initialize log handler early so we can have proper logging during startup. */ ws_log_init("dpauxmon", NULL); + /* Early logging command-line initialization. */ + ws_log_parse_args(&argc, argv, NULL, LOG_ARGS_NOEXIT); + /* * Get credential information for later use. */ diff --git a/extcap/etwdump.c b/extcap/etwdump.c index 9d6d8fa7ae..a89cd4b677 100644 --- a/extcap/etwdump.c +++ b/extcap/etwdump.c @@ -125,6 +125,9 @@ int main(int argc, char* argv[]) /* Initialize log handler early so we can have proper logging during startup. */ ws_log_init("etwdump", NULL); + /* Early logging command-line initialization. */ + ws_log_parse_args(&argc, argv, NULL, LOG_ARGS_NOEXIT); + /* * Get credential information for later use. */ diff --git a/extcap/randpktdump.c b/extcap/randpktdump.c index f1f18cd19e..2e5f90146c 100644 --- a/extcap/randpktdump.c +++ b/extcap/randpktdump.c @@ -151,13 +151,13 @@ int main(int argc, char *argv[]) char* help_url; char* help_header = NULL; + cmdarg_err_init(randpktdump_cmdarg_err, randpktdump_cmdarg_err); + /* Initialize log handler early so we can have proper logging during startup. */ ws_log_init("randpktdump", NULL); - cmdarg_err_init(randpktdump_cmdarg_err, randpktdump_cmdarg_err); - /* Early logging command-line initialization. */ - ws_log_parse_args(&argc, argv, vcmdarg_err, EXIT_FAILURE); + ws_log_parse_args(&argc, argv, NULL, LOG_ARGS_NOEXIT); /* * Get credential information for later use. diff --git a/extcap/sdjournal.c b/extcap/sdjournal.c index 71b163b470..d1d9791933 100644 --- a/extcap/sdjournal.c +++ b/extcap/sdjournal.c @@ -344,6 +344,9 @@ int main(int argc, char **argv) /* Initialize log handler early so we can have proper logging during startup. */ ws_log_init("sdjournal", NULL); + /* Early logging command-line initialization. */ + ws_log_parse_args(&argc, argv, NULL, LOG_ARGS_NOEXIT); + /* * Get credential information for later use. */ diff --git a/extcap/sshdump.c b/extcap/sshdump.c index 80bab13f79..afb7693193 100644 --- a/extcap/sshdump.c +++ b/extcap/sshdump.c @@ -365,6 +365,9 @@ int main(int argc, char *argv[]) /* Initialize log handler early so we can have proper logging during startup. */ ws_log_init("sshdump", NULL); + /* Early logging command-line initialization. */ + ws_log_parse_args(&argc, argv, NULL, LOG_ARGS_NOEXIT); + sshdump_extcap_interface = g_path_get_basename(argv[0]); /* diff --git a/extcap/udpdump.c b/extcap/udpdump.c index 44361e17c5..ed20ef2dd0 100644 --- a/extcap/udpdump.c +++ b/extcap/udpdump.c @@ -371,6 +371,9 @@ int main(int argc, char *argv[]) /* Initialize log handler early so we can have proper logging during startup. */ ws_log_init("udpdump", NULL); + /* Early logging command-line initialization. */ + ws_log_parse_args(&argc, argv, NULL, LOG_ARGS_NOEXIT); + /* * Get credential information for later use. */ |