summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2016-01-22 13:08:44 +0000
committergilles <gilles@openbsd.org>2016-01-22 13:08:44 +0000
commit27c7fbfb8957ece751b4a86567ad1e849d6d7bcc (patch)
tree540f3d260998b0c993d8290bb2916c20ccdfc1a8 /usr.sbin
parentMerge read_block() and read_file_media() into read_block(). Ditto (diff)
downloadwireguard-openbsd-27c7fbfb8957ece751b4a86567ad1e849d6d7bcc.tar.xz
wireguard-openbsd-27c7fbfb8957ece751b4a86567ad1e849d6d7bcc.zip
add a log_warn() so that when smtpd fails to start due to a problem reading
the configuration file of a table, user actually understands what happens diff by Alexis Vachette, ok jung@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/table_static.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/table_static.c b/usr.sbin/smtpd/table_static.c
index 65892cbedc2..a2031849410 100644
--- a/usr.sbin/smtpd/table_static.c
+++ b/usr.sbin/smtpd/table_static.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table_static.c,v 1.14 2015/12/28 22:08:30 jung Exp $ */
+/* $OpenBSD: table_static.c,v 1.15 2016/01/22 13:08:44 gilles Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
@@ -91,9 +91,10 @@ table_static_parse(struct table *t, const char *config, enum table_type type)
char *valp;
size_t ret = 0;
- fp = fopen(config, "r");
- if (fp == NULL)
- return 0;
+ if ((fp = fopen(config, "r")) == NULL) {
+ log_warn("warn: Table \"%s\"", config);
+ return 0;
+ }
while ((flen = getline(&buf, &sz, fp)) != -1) {
if (buf[flen - 1] == '\n')