diff options
author | João Valverde <j@v6e.pt> | 2021-06-19 19:44:58 +0100 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-06-21 16:03:29 +0000 |
commit | 759bb234d0eb4d36947213fca2bc14e386c1cc8f (patch) | |
tree | ec9ba564273b0d0db43bd1d9691feee79d4a41d1 /reordercap.c | |
parent | c216bb85e75e3db7050f937d6925ba85fb3e6803 (diff) |
wslog: Check if we are initialized and add missing inits
Instead of receiving the program name from GLib, pass it explicitly
to ws_log_init() instead and use that to initialize the GLib program
name.
ws_log_parse_args() will now exit the program when it encounters an
argument error if exit_failure >= 0.
Diffstat (limited to 'reordercap.c')
-rw-r--r-- | reordercap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/reordercap.c b/reordercap.c index b79c3d61c8..27f7c5350d 100644 --- a/reordercap.c +++ b/reordercap.c @@ -44,6 +44,7 @@ #endif #include <wsutil/report_message.h> +#include <wsutil/wslog.h> #include "ui/failure_message.h" @@ -207,8 +208,14 @@ main(int argc, char *argv[]) char *infile; const char *outfile; + /* Initialize log handler early so we can have proper logging during startup. */ + ws_log_init("reordercap", NULL); + cmdarg_err_init(reordercap_cmdarg_err, reordercap_cmdarg_err_cont); + /* Early logging command-line initialization. */ + ws_log_parse_args(&argc, argv, vcmdarg_err, INVALID_OPTION); + /* Initialize the version information. */ ws_init_version_info("Reordercap (Wireshark)", NULL, NULL, NULL); |