summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/unwind/unwind.c12
-rw-r--r--sbin/unwind/uw_parse.y6
2 files changed, 7 insertions, 11 deletions
diff --git a/sbin/unwind/unwind.c b/sbin/unwind/unwind.c
index 7e829e48919..e582d60b969 100644
--- a/sbin/unwind/unwind.c
+++ b/sbin/unwind/unwind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unwind.c,v 1.7 2019/01/29 19:13:01 florian Exp $ */
+/* $OpenBSD: unwind.c,v 1.8 2019/01/29 20:03:49 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -171,14 +171,8 @@ main(int argc, char *argv[])
else if (frontend_flag)
frontend(debug, cmd_opts & (OPT_VERBOSE | OPT_VERBOSE2));
- if (access(conffile, R_OK) == -1 && errno == ENOENT) {
- main_conf = config_new_empty();
- } else {
- /* parse config file */
- if ((main_conf = parse_config(conffile)) == NULL) {
- exit(1);
- }
- }
+ if ((main_conf = parse_config(conffile)) == NULL)
+ exit(1);
if (cmd_opts & OPT_NOACTION) {
if (cmd_opts & OPT_VERBOSE)
diff --git a/sbin/unwind/uw_parse.y b/sbin/unwind/uw_parse.y
index 4c2966da1ac..bdda384e7e3 100644
--- a/sbin/unwind/uw_parse.y
+++ b/sbin/unwind/uw_parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: uw_parse.y,v 1.4 2019/01/29 18:55:34 otto Exp $ */
+/* $OpenBSD: uw_parse.y,v 1.5 2019/01/29 20:03:49 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -622,7 +622,6 @@ pushfile(const char *name, int secret)
return (NULL);
}
if ((nfile->stream = fopen(nfile->name, "r")) == NULL) {
- log_warn("%s", nfile->name);
free(nfile->name);
free(nfile);
return (NULL);
@@ -673,6 +672,9 @@ parse_config(char *filename)
file = pushfile(filename, 0);
if (file == NULL) {
+ if (errno == ENOENT) /* no config file is fine */
+ return (conf);
+ log_warn("%s", filename);
free(conf);
return (NULL);
}