From 7e5444c100acf5b1a3ede415b4898dfdf95b30aa Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Tue, 11 Jan 2005 03:48:56 +0000 Subject: [PATCH] Better error messages on missing config --- src/configfile.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index 610cb1e5..5fa43ee1 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -240,6 +240,13 @@ int config_read(char *file) { if((fin=fopen(file,"r")) == NULL) { err=errno; free(buffer); + + if(ENOENT == err) { + DPRINTF(E_LOG,L_CONF,"Whoops! Can't find the config file! If you are running this for the first\n"); + DPRINTF(E_LOG,L_CONF,"time, then perhaps you've forgotten to copy the sample config in the \n"); + DPRINTF(E_LOG,L_CONF,"contrib directory into /etc/mt-daapd.conf. Just a suggestion...\n\n"); + } + errno=err; return -1; } @@ -398,8 +405,10 @@ int config_read(char *file) { if(!strncmp(ZLIB_VERSION,"0.",2) || !strncmp(ZLIB_VERSION,"1.0",3) || !strncmp(ZLIB_VERSION,"1.1",3)) { - config.compress=0; - DPRINTF(E_LOG,L_CONF,"Must have zlib > 1.2.0 to use gzip content encoding. You have %s. Sucks, huh?\n",ZLIB_VERSION); + if(config.compress) { + config.compress=0; + DPRINTF(E_LOG,L_CONF,"Must have zlib > 1.2.0 to use gzip content encoding. You have %s. Disabling.\n",ZLIB_VERSION); + } } return err;