aboutsummaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-06-09 17:24:37 +0000
committerOmar Polo <op@omarpolo.com>2023-06-09 17:24:37 +0000
commit68368f4c29e208c67724b04fd0142e233a247a2a (patch)
tree2a4c6596dbd28f3f726d467e4222f677dae5cf18 /parse.y
parentaf1dab18702cf135aa80bf15065f73050c915347 (diff)
parse_conf: don't die on error, return -1
this avoids having the daemon dieing on SIGHUP with a bad config file.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index de0405b..11d4250 100644
--- a/parse.y
+++ b/parse.y
@@ -908,7 +908,7 @@ popfile(void)
return file ? 0 : EOF;
}
-void
+int
parse_conf(struct conf *c, const char *filename)
{
struct sym *sym, *next;
@@ -917,7 +917,7 @@ parse_conf(struct conf *c, const char *filename)
file = pushfile(filename, 0);
if (file == NULL)
- exit(1);
+ return -1;
topfile = file;
yyparse();
@@ -936,7 +936,8 @@ parse_conf(struct conf *c, const char *filename)
}
if (errors)
- exit(1);
+ return -1;
+ return 0;
}
void