From cc5c9640e4e5b766473e227d38ee24c123d9bea6 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 10 Mar 2009 20:48:54 +0100 Subject: [PATCH] configfile, types_list: Improved error messages when handling "TypesDB". --- src/configfile.c | 9 +++++++-- src/types_list.c | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index bb57ca26..580b24b6 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -205,13 +205,18 @@ static int dispatch_value_typesdb (const oconfig_item_t *ci) cf_default_typesdb = 0; - if (ci->values_num < 1) + if (ci->values_num < 1) { + ERROR ("configfile: `TypesDB' needs at least one argument."); return (-1); + } for (i = 0; i < ci->values_num; ++i) { - if (OCONFIG_TYPE_STRING != ci->values[i].type) + if (OCONFIG_TYPE_STRING != ci->values[i].type) { + WARNING ("configfile: TypesDB: Skipping %i. argument which " + "is not a string.", i + 1); continue; + } read_types_list (ci->values[i].value.string); } diff --git a/src/types_list.c b/src/types_list.c index 7600c346..ed832fee 100644 --- a/src/types_list.c +++ b/src/types_list.c @@ -172,7 +172,9 @@ int read_types_list (const char *file) if (fh == NULL) { char errbuf[1024]; - ERROR ("open (%s) failed: %s", + fprintf (stderr, "Failed to open types database `%s': %s.\n", + file, sstrerror (errno, errbuf, sizeof (errbuf))); + ERROR ("Failed to open types database `%s': %s", file, sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } -- 2.30.2