summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Marcher <info@nulltime.net>2016-03-10 15:50:35 +0100
committerAaron Marcher (drkhsh) <info@nulltime.net>2016-03-10 15:50:35 +0100
commitd4d2646f6387f0245ce1e285382f85b2cb6c0300 (patch)
tree18e84fc0acfb32ef917f58d225d14d715d46ac6e
parent83eae75dcf4659b55382873655081916e4bf100f (diff)
added update_interval check to config_check()
-rw-r--r--slstatus.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/slstatus.c b/slstatus.c
index 86d27eb..23ed940 100644
--- a/slstatus.c
+++ b/slstatus.c
@@ -42,9 +42,17 @@ int
config_check()
{
struct stat fs;
+
+ /* check all files in the config.h file */
CHECK_FILE(batterynowfile, fs);
CHECK_FILE(batteryfullfile, fs);
CHECK_FILE(tempfile, fs);
+
+ /* check update interval */
+ if (update_interval < 1)
+ return -1;
+
+ /* exit successfully */
return 0;
}
@@ -337,7 +345,7 @@ main()
/* check config for sanity */
if (config_check() < 0) {
- fprintf(stderr, "Config error, please check paths and recompile\n");
+ fprintf(stderr, "Config error, please check paths and interval and recompile!\n");
exit(1);
}