summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/glbl.h3
-rw-r--r--runtime/rsyslog.c3
-rw-r--r--runtime/rsyslog.h11
-rw-r--r--tools/syslogd.c1
4 files changed, 14 insertions, 4 deletions
diff --git a/runtime/glbl.h b/runtime/glbl.h
index 0db2f0ac..d61f9b41 100644
--- a/runtime/glbl.h
+++ b/runtime/glbl.h
@@ -34,9 +34,6 @@
#define glblGetIOBufSize() 4096 /* size of the IO buffer, e.g. for strm class */
-extern uchar *glblModPath; /* module load path */
-
-
/* interfaces */
BEGINinterface(glbl) /* name must also be changed in ENDinterface macro! */
uchar* (*GetWorkDir)(void);
diff --git a/runtime/rsyslog.c b/runtime/rsyslog.c
index b7f0c2c1..d0eaa6f8 100644
--- a/runtime/rsyslog.c
+++ b/runtime/rsyslog.c
@@ -76,6 +76,9 @@
#include "conf.h"
#include "glbl.h"
+/* globally visible static data - see comment in rsyslog.h for details */
+uchar *glblModPath; /* module load path */
+
/* static data */
static int iRefCount = 0; /* our refcount - it MUST exist only once inside a process (not thread)
thus it is perfectly OK to use a static. MUST be initialized to 0! */
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index 3841df6c..5a3175e2 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -287,6 +287,17 @@ void dbgprintf(char *, ...) __attribute__((format(printf, 1, 2)));
#include "debug.h"
#include "obj.h"
+/* the variable below is a trick: before we can init the runtime, the caller
+ * may want to set a module load path. We can not do this via the glbl class
+ * because it needs an initialized runtime system (and may at some point in time
+ * even be loaded itself). So this is a no-go. What we do is use a single global
+ * variable which may be provided with a pointer by the caller. This variable
+ * resides in rsyslog.c, the main runtime file. We have not seen any realy valule
+ * in providing object access functions. If you don't like that, feel free to
+ * add them. -- rgerhards, 2008-04-17
+ */
+extern uchar *glblModPath; /* module load path */
+
/* some runtime prototypes */
rsRetVal rsrtInit(char **ppErrObj, obj_if_t *pObjIF);
rsRetVal rsrtExit(void);
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 33a33823..67c7d11b 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -288,7 +288,6 @@ static int bEscapeCCOnRcv = 1; /* escape control characters on reception: 0 - n
int bReduceRepeatMsgs; /* reduce repeated message - 0 - no, 1 - yes */
int bActExecWhenPrevSusp; /* execute action only when previous one was suspended? */
int iActExecOnceInterval = 0; /* execute action once every nn seconds */
-uchar *glblModPath = NULL; /* module load path - only used during initial init, only settable via -M command line option */
/* end global config file state variables */
int MarkInterval = 20 * 60; /* interval between marks in seconds - read-only after startup */