Have scan_plugins() take an argument specify what to do on load failures.
[metze/wireshark/wip.git] / randpkt.c
index f604e77812a944f2a8c3082cefe479eae944fec6..4346afb52cc7c7c7c81482a0a01b3d864ddb95c7 100644 (file)
--- a/randpkt.c
+++ b/randpkt.c
 
 #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 randpkt.
  */
 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, "randpkt: ");
+       vfprintf(stderr, msg_format, ap);
+       fprintf(stderr, "\n");
 }
 #endif
 
@@ -141,8 +141,13 @@ 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();