summaryrefslogtreecommitdiffstats
path: root/runtime/rsyslog.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-16 18:01:26 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-16 18:01:26 +0200
commitbf3e0d4f224a26e2ac9bc3edfd1e6eedcf56c9f8 (patch)
treec74263495311d4ffbeb55f0fb27d102144f55024 /runtime/rsyslog.c
parent5987107df46157eb847bc8271157ab8a7c73f6f4 (diff)
downloadrsyslog-bf3e0d4f224a26e2ac9bc3edfd1e6eedcf56c9f8.tar.gz
rsyslog-bf3e0d4f224a26e2ac9bc3edfd1e6eedcf56c9f8.tar.xz
rsyslog-bf3e0d4f224a26e2ac9bc3edfd1e6eedcf56c9f8.zip
prevented segfault during runtime library init phase
Diffstat (limited to 'runtime/rsyslog.c')
-rw-r--r--runtime/rsyslog.c15
1 files changed, 15 insertions, 0 deletions
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:
*/