Ethereal-dev: [Ethereal-dev] Small plugin loading patch

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ruud Linders <ruud@xxxxxxxxxx>
Date: Thu, 18 Apr 2002 10:00:34 +0200

While trying to get Andreas's h323 plugin  (http://www.voice2sniff.org/
another *shameless plug* :-) ) to build for Linux, I couldn't figure out
why the *&^*% the h323.so plugin wouldn't show up in the plugin list.

It turned out to be some undefined symbols which were very nicely shown
by this very simple patch, without it, the module loading was just silently
failing.


--- epan/plugins.c.ORIG Sat Feb 23 20:12:26 2002
+++ epan/plugins.c      Thu Apr 18 09:47:20 2002
@@ -196,7 +196,12 @@

            snprintf(filename, FILENAME_LEN, "%s" G_DIR_SEPARATOR_S "%s",
                dirname, file->d_name);
-           if ((handle = g_module_open(filename, 0)) == NULL) continue;
+           if ((handle = g_module_open(filename, 0)) == NULL)
+             {
+               g_warning("loading module <%s> failed \n( %s )\n",
+                         filename, g_module_error() );
+               continue;
+             }
            name = (gchar *)file->d_name;
            if (g_module_symbol(handle, "version", (gpointer*)&version) == FALSE
)
            {

_
Ruud Linders
--- epan/plugins.c.ORIG	Sat Feb 23 20:12:26 2002
+++ epan/plugins.c	Thu Apr 18 09:47:20 2002
@@ -196,7 +196,12 @@
 
 	    snprintf(filename, FILENAME_LEN, "%s" G_DIR_SEPARATOR_S "%s",
 	        dirname, file->d_name);
-	    if ((handle = g_module_open(filename, 0)) == NULL) continue;
+	    if ((handle = g_module_open(filename, 0)) == NULL)
+	      {
+		g_warning("loading module <%s> failed \n( %s )\n",
+			  filename, g_module_error() );
+		continue;
+	      }
 	    name = (gchar *)file->d_name;
 	    if (g_module_symbol(handle, "version", (gpointer*)&version) == FALSE)
 	    {