Simplify plugin descriptor checking
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 18 Oct 2008 17:06:34 +0000 (19:06 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 18 Oct 2008 17:06:34 +0000 (19:06 +0200)
src/plugin.c

index 153b7be..c128505 100644 (file)
@@ -40,6 +40,9 @@ static gboolean add_plugin(void *handle, struct connman_plugin_desc *desc)
 {
        struct connman_plugin *plugin;
 
+       if (desc->init == NULL)
+               return FALSE;
+
        plugin = g_try_new0(struct connman_plugin, 1);
        if (plugin == NULL)
                return FALSE;
@@ -94,11 +97,6 @@ int __connman_plugin_init(void)
                                continue;
                        }
 
-                       if (desc->init == NULL) {
-                               dlclose(handle);
-                               continue;
-                       }
-
                        if (add_plugin(handle, desc) == FALSE)
                                dlclose(handle);
                }