diff src/dnsbl.cpp @ 40:dc3d8d1aa2d2

fix handling of missing include files
author carl
date Mon, 07 Jun 2004 21:07:40 -0700
parents 6e9d0b2d0720
children d95af8129dfa
line wrap: on
line diff
--- a/src/dnsbl.cpp	Mon Jun 07 21:07:40 2004 -0700
+++ b/src/dnsbl.cpp	Mon Jun 07 21:07:40 2004 -0700
@@ -897,7 +897,12 @@
 static void load_conf_dcc(CONFIG &dc, char *name, char *fn);
 static void load_conf_dcc(CONFIG &dc, char *name, char *fn) {
     ifstream is(fn);
-    if (is.fail()) return;
+    if (is.fail()) {
+        char buf[1000];
+        snprintf(buf, sizeof(buf), "include file %s not found", fn);
+        my_syslog(buf);
+        return;
+    }
     dc.config_files.push_back(fn);
     const int LINE_SIZE = 2000;
     char line[LINE_SIZE];
@@ -960,7 +965,12 @@
 static void load_conf(CONFIG &dc, char *fn);
 static void load_conf(CONFIG &dc, char *fn) {
     ifstream is(fn);
-    if (is.fail()) return;
+    if (is.fail()) {
+        char buf[1000];
+        snprintf(buf, sizeof(buf), "include file %s not found", fn);
+        my_syslog(buf);
+        return;
+    }
     dc.config_files.push_back(fn);
     map<char*, int, ltstr> commands;
     enum {dummy, tld, content, hostlimit, htmllimit, htmltag, dnsbl, dnsbll, envfrom, envto, include, includedcc};