plugin: improves error detection
[src/app-framework-binder.git] / src / main.c
index 124d7e4..44580c8 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2015 "IoT.bzh"
+ * Copyright (C) 2015, 2016 "IoT.bzh"
  * Author "Fulup Ar Foll"
  * Author José Bollo <jose.bollo@iot.bzh>
  *
@@ -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"
@@ -131,7 +131,7 @@ static void printVersion (FILE *file)
    fprintf(file, "\n----------------------------------------- \n");
    fprintf(file, "  AFB [Application Framework Binder] version=%s |\n", AFB_VERSION);
    fprintf(file, " \n");
-   fprintf(file, "  Copyright(C) 2016 /IoT.bzh [fulup -at- iot.bzh]\n");
+   fprintf(file, "  Copyright (C) 2015, 2016 \"IoT.bzh\" [fulup -at- iot.bzh]\n");
    fprintf(file, "  AFB comes with ABSOLUTELY NO WARRANTY.\n");
    fprintf(file, "  Licence Apache 2\n\n");
    exit (0);
@@ -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;