diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-09-05 16:26:29 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-09-05 23:27:02 +0000 |
commit | 2a38dc74ede3eba69f0d73b61f1735a4036528c1 (patch) | |
tree | c03b1f72dcd66c54907d546a45c28315ba35fd27 /mergecap.c | |
parent | ae877942ea507128d3191e17075a26b86e52615d (diff) |
Have scan_plugins() take an argument specify what to do on load failures.
That's a less gross hack to suppress load failures due to not having
libwiretap than providing a no-op failure-message routine, as it at
least allows other code using a failure-message routine, such as
cmdarg_err() and routines that call it, to be used.
We really should put libwiretap and libwireshark plugins into separate
subdirectories of the plugin directories, and avoid even looking at
libwireshark plugins in programs that don't use libwireshark.
Change-Id: I0a6ec01ecb4e718ed36233cfaf638a317f839a73
Reviewed-on: https://code.wireshark.org/review/17506
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'mergecap.c')
-rw-r--r-- | mergecap.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/mergecap.c b/mergecap.c index c6c97619ef..089ef0254d 100644 --- a/mergecap.c +++ b/mergecap.c @@ -129,14 +129,14 @@ string_elem_print(gpointer data, gpointer not_used _U_) #ifdef HAVE_PLUGINS /* - * Don't report failures to load plugins because most (non-wiretap) plugins - * *should* fail to load (because we're not linked against libwireshark and - * dissector plugins need libwireshark). + * General errors are reported with an console message in mergecap. */ static void -failure_message(const char *msg_format _U_, va_list ap _U_) +failure_message(const char *msg_format, va_list ap) { - return; + fprintf(stderr, "mergecap: "); + vfprintf(stderr, msg_format, ap); + fprintf(stderr, "\n"); } #endif @@ -310,8 +310,12 @@ main(int argc, char *argv[]) init_report_err(failure_message,NULL,NULL,NULL); /* Scan for plugins. This does *not* call their registration routines; - that's done later. */ - scan_plugins(); + that's done later. + + Don't report failures to load plugins because most (non-wiretap) + plugins *should* fail to load (because we're not linked against + libwireshark and dissector plugins need libwireshark).*/ + scan_plugins(DONT_REPORT_LOAD_FAILURE); /* Register all libwiretap plugin modules. */ register_all_wiretap_modules(); |