plugin: improves error detection
[src/app-framework-binder.git] / src / main.c
index fdea907..44580c8 100644 (file)
@@ -41,7 +41,7 @@
 #include "verbose.h"
 #include "afb-common.h"
 
-#include "afb-plugin.h"
+#include <afb/afb-plugin.h>
 
 #if !defined(PLUGIN_INSTALL_DIR)
 #error "you should define PLUGIN_INSTALL_DIR"
@@ -584,8 +584,12 @@ int main(int argc, char *argv[])  {
      exit (1);
   }
 
-  if (config->ldpaths) 
-    afb_api_so_add_pathset(config->ldpaths);
+  if (config->ldpaths) {
+    if (afb_api_so_add_pathset(config->ldpaths) < 0) {
+      ERROR("initialisation of plugins within %s failed", config->ldpaths);
+      exit(1);
+    }
+  }
 
   start_items(config->items);
   config->items = NULL;