diff --git a/src/core/plugin.c b/src/core/plugin.c
index 929abaee8467cf4bc7f419c324cdd7c6b46a339f..188c7db1515859739efff2c456bd00c62f893f98 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
ctx_destroy
};
-static ctx_t *
-ctx_create(const char *name)
-{
- ctx_t *ctx;
-
- ctx = CTX(sdb_object_create(name, ctx_type));
- if (! ctx)
- return NULL;
-
- if (! plugin_ctx_key_initialized)
- ctx_key_init();
- sdb_object_ref(SDB_OBJ(ctx));
- pthread_setspecific(plugin_ctx_key, ctx);
- return ctx;
-} /* ctx_create */
-
static ctx_t *
ctx_get(void)
{
return old;
} /* ctx_set */
+static ctx_t *
+ctx_create(const char *name)
+{
+ ctx_t *ctx;
+
+ ctx = CTX(sdb_object_create(name, ctx_type));
+ if (! ctx)
+ return NULL;
+
+ if (! plugin_ctx_key_initialized)
+ ctx_key_init();
+ ctx_set(ctx);
+ return ctx;
+} /* ctx_create */
+
static int
plugin_cb_init(sdb_object_t *obj, va_list ap)
{
if (! msg)
return 0;
- if (! log_list)
+ if (! sdb_llist_len(log_list))
return fprintf(stderr, "[%s] %s\n", SDB_LOG_PRIO_TO_STRING(prio), msg);
iter = sdb_llist_get_iter(log_list);