From bf3e0d4f224a26e2ac9bc3edfd1e6eedcf56c9f8 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 16 Apr 2008 18:01:26 +0200 Subject: prevented segfault during runtime library init phase --- runtime/rsyslog.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'runtime/rsyslog.c') diff --git a/runtime/rsyslog.c b/runtime/rsyslog.c index 0d983bb1..6051cc57 100644 --- a/runtime/rsyslog.c +++ b/runtime/rsyslog.c @@ -162,5 +162,20 @@ rsrtExit(obj_if_t *pObjIF) } +/* returns 0 if the rsyslog runtime is not initialized and another value + * if it is. This function is primarily meant to be used by runtime functions + * itself. However, it is safe to call it before initializing the runtime. + * Plugins should NOT rely on this function. The reason is that another caller + * may have already initialized it but deinits it before this plugin is done. + * So for plugins and like architectures, the right course of action is to + * call rsrtInit() and rsrtExit(), which can be called by multiple callers. + * rgerhards, 2008-04-16 + */ +int rsrtIsInit(void) +{ + return iRefCount; +} + + /* vim:set ai: */ -- cgit v1.2.3