in case NULL is returned, log an error and do not register
the plugin.
Signed-off-by: Yannick Gicquel <yannick.gicquel@iot.bzh>
if (verbose) fprintf(stderr, "[%s] is a valid AFB plugin, loading pos[%d]\n", pluginDir.d_name, *count);
plugins[*count] = pluginRegisterFct();
- *count = *count +1;
-
+ if (!plugins[*count]) {
+ if (verbose) fprintf(stderr, "ERROR: plugin [%s] register function failed. continuing...\n", pluginDir.d_name);
+ } else
+ *count = *count +1;
}
}
closedir (dir);