summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-08-16 09:18:52 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-08-16 09:18:52 +0200
commit57a95c6790fd080020c49c79557619fd129a66e0 (patch)
tree05878ebcc65837f792835ecc0afac13beb7474ad /config.h
parentfc19cf3527d42d88f428b6fa7a935c2dc7cfe781 (diff)
downloadvdr-57a95c6790fd080020c49c79557619fd129a66e0.tar.gz
vdr-57a95c6790fd080020c49c79557619fd129a66e0.tar.bz2
VDR now stops with result value 2 if one of the configuration files can't be read correctly at program startup
Diffstat (limited to 'config.h')
-rw-r--r--config.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/config.h b/config.h
index 9e6f6e2e..c4590a77 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h 1.166 2003/08/06 14:45:10 kls Exp $
+ * $Id: config.h 1.167 2003/08/16 09:08:33 kls Exp $
*/
#ifndef __CONFIG_H
@@ -87,7 +87,7 @@ public:
cConfig(void) { fileName = NULL; }
virtual ~cConfig() { free(fileName); }
const char *FileName(void) { return fileName; }
- bool Load(const char *FileName = NULL, bool AllowComments = false)
+ bool Load(const char *FileName = NULL, bool AllowComments = false, bool MustExist = false)
{
Clear();
if (FileName) {
@@ -95,7 +95,7 @@ public:
fileName = strdup(FileName);
allowComments = AllowComments;
}
- bool result = false;
+ bool result = !MustExist;
if (fileName && access(fileName, F_OK) == 0) {
isyslog("loading %s", fileName);
FILE *f = fopen(fileName, "r");
@@ -125,9 +125,13 @@ public:
}
fclose(f);
}
- else
+ else {
LOG_ERROR_STR(fileName);
+ result = false;
+ }
}
+ if (!result)
+ fprintf(stderr, "vdr: error while reading '%s'\n", fileName);
return result;
}
bool Save(void)