diff --git a/src/core/plugin.c b/src/core/plugin.c
index dc3717b3dcdf468a290b2b4d2e7214397fb017b2..8cd490a22a7da2f39e946f4d06be445fda1ebba7 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
} /* module_init */
static int
} /* module_init */
static int
-module_load(const char *name, const sdb_plugin_ctx_t *plugin_ctx)
+module_load(const char *basedir, const char *name,
+ const sdb_plugin_ctx_t *plugin_ctx)
{
char base_name[name ? strlen(name) + 1 : 1];
const char *name_ptr;
{
char base_name[name ? strlen(name) + 1 : 1];
const char *name_ptr;
}
strcat(base_name, name_ptr);
}
strcat(base_name, name_ptr);
- snprintf(filename, sizeof(filename), "%s/%s.so",
- PKGLIBDIR, base_name);
+ if (! basedir)
+ basedir = PKGLIBDIR;
+
+ snprintf(filename, sizeof(filename), "%s/%s.so", basedir, base_name);
filename[sizeof(filename) - 1] = '\0';
if (access(filename, R_OK)) {
filename[sizeof(filename) - 1] = '\0';
if (access(filename, R_OK)) {
*/
int
*/
int
-sdb_plugin_load(const char *name, const sdb_plugin_ctx_t *plugin_ctx)
+sdb_plugin_load(const char *basedir, const char *name,
+ const sdb_plugin_ctx_t *plugin_ctx)
{
ctx_t *ctx;
{
ctx_t *ctx;
return 0;
}
return 0;
}
- return module_load(name, plugin_ctx);
+ return module_load(basedir, name, plugin_ctx);
} /* sdb_plugin_load */
int
} /* sdb_plugin_load */
int
sdb_log(SDB_LOG_ERR, "core: Failed to sleep "
"in collector main loop: %s",
sdb_strerror(errno, errbuf, sizeof(errbuf)));
sdb_log(SDB_LOG_ERR, "core: Failed to sleep "
"in collector main loop: %s",
sdb_strerror(errno, errbuf, sizeof(errbuf)));
+ sdb_llist_insert_sorted(collector_list, obj,
+ plugin_cmp_next_update);
+ sdb_object_deref(obj);
return -1;
}
errno = 0;
return -1;
}
errno = 0;