diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-04 08:34:31 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-04 08:34:31 +0000 |
commit | f5250a3a92ec4c1738556f3cc5139dbc15579add (patch) | |
tree | 796ab385480e9d1cb7079c4c3b90378b0e254466 /modules.c | |
parent | 54751c7e6e374c130d6d6d5cee5db493f7919fef (diff) | |
download | rsyslog-f5250a3a92ec4c1738556f3cc5139dbc15579add.tar.gz rsyslog-f5250a3a92ec4c1738556f3cc5139dbc15579add.tar.xz rsyslog-f5250a3a92ec4c1738556f3cc5139dbc15579add.zip |
changed command line processing. -v, -M, -c options are now parsed and
processed before all other options. Inter-option dependencies have been
relieved. Among others, permits to specify intial module load path via
-M only (not the environment) which makes it much easier to work with
non-standard module library locations. Thanks to varmojfekoj for
suggesting this change. Matches bugzilla bug 55.
Diffstat (limited to 'modules.c')
-rw-r--r-- | modules.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -783,6 +783,17 @@ BEGINAbstractObjClassInit(module, 1, OBJ_IS_CORE_MODULE) /* class, version - CHA SetModDir(pModPath); } + /* now check if another module path was set via the command line (-M) + * if so, that overrides the environment. Please note that we must use + * a global setting here because the command line parser can NOT call + * into the module object, because it is not initialized at that point. So + * instead a global setting is changed and we pick it up as soon as we + * initialize -- rgerhards, 2008-04-04 + */ + if(glblModPath != NULL) { + SetModDir(glblModPath); + } + /* request objects we use */ CHKiRet(objUse(errmsg, CORE_COMPONENT)); ENDObjClassInit(module) |