projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e192ffc
)
added error message if modules block is missing in configuration
author
pk910
<philipp@zoelle1.de>
Sat, 18 Feb 2012 18:46:15 +0000
(19:46 +0100)
committer
pk910
<philipp@zoelle1.de>
Sat, 18 Feb 2012 18:46:15 +0000
(19:46 +0100)
src/main.c
patch
|
blob
|
history
src/modules.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index fa8aee1f8bb24135776721aba6394c41705627b5..1287faf242dcba4c22148ccc945e55931ad570ea 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-216,6
+216,12
@@
int main(int argc, char *argv[]) {
exit(0);
}
check_firstrun();
exit(0);
}
check_firstrun();
+ char **modulelist = get_all_fieldnames("modules");
+ if(!modulelist || !modulelist[0]) {
+ fprintf(stderr, "no modules loaded... Please update your configuration!\n");
+ exit(0);
+ }
+ free(modulelist);
if (run_as_daemon) {
#ifndef WIN32
/* Attempt to fork into the background if daemon mode is on. */
if (run_as_daemon) {
#ifndef WIN32
/* Attempt to fork into the background if daemon mode is on. */
diff --git
a/src/modules.c
b/src/modules.c
index d024c3e186f3abb39bdf80534cf77aa3f16f2d8d..ba3a43a6b8fb32937ad4665bc464d74bb3de053b 100644
(file)
--- a/
src/modules.c
+++ b/
src/modules.c
@@
-259,6
+259,7
@@
static void unregister_module_hooks(int module_id);
void loadModules() {
char **modulelist = get_all_fieldnames("modules");
void loadModules() {
char **modulelist = get_all_fieldnames("modules");
+ if(!modulelist) return;
int i = 0;
char tmp[MAXLEN];
struct ModuleInfo *modinfo;
int i = 0;
char tmp[MAXLEN];
struct ModuleInfo *modinfo;
@@
-272,6
+273,7
@@
void loadModules() {
}
i++;
}
}
i++;
}
+ free(modulelist);
start_modules();
}
start_modules();
}