From 295dbc609dab17d396a69e460ac956151d3ef32d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 6 Sep 2016 10:14:12 -0700 Subject: Suppress another warning if told not to report failures. That's another failure that can occur if you're trying to load a libwireshark plugin in a program that doesn't use libwireshark if, for example, references to an undefined symbol don't prevent the module from being loaded in the first place. Change-Id: I21629c0094fdca7dfbd88f39b7e6c10fb600b401 Reviewed-on: https://code.wireshark.org/review/17537 Reviewed-by: Guy Harris --- wsutil/plugins.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'wsutil') diff --git a/wsutil/plugins.c b/wsutil/plugins.c index f2da1f57d2..5bb530dd23 100644 --- a/wsutil/plugins.c +++ b/wsutil/plugins.c @@ -219,9 +219,24 @@ plugins_scan_dir(const char *dirname, plugin_load_failure_mode mode) { /* * No. + * + * Only report this failure if we were asked to; it might + * just mean that it's a plugin type that this program + * doesn't support, such as a libwireshark plugin in + * a program that doesn't use libwireshark. + * + * XXX - we really should put different types of plugins + * (libwiretap, libwireshark) in different subdirectories, + * give libwiretap and libwireshark init routines that + * load the plugins, and have them scan the appropriate + * subdirectories so tha we don't even *try* to, for + * example, load libwireshark plugins in programs that + * only use libwiretap. */ - report_failure("The plugin '%s' has no registration routines", - name); + if (mode == REPORT_LOAD_FAILURE) { + report_failure("The plugin '%s' has no registration routines", + name); + } g_module_close(handle); g_free(new_plug->name); g_free(new_plug); -- cgit v1.2.1