Better error messages on missing config

This commit is contained in:
Ron Pedde 2005-01-11 03:48:56 +00:00
parent 9dbd40bde8
commit 7e5444c100
1 changed files with 11 additions and 2 deletions

View File

@ -240,6 +240,13 @@ int config_read(char *file) {
if((fin=fopen(file,"r")) == NULL) { if((fin=fopen(file,"r")) == NULL) {
err=errno; err=errno;
free(buffer); 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; errno=err;
return -1; return -1;
} }
@ -398,8 +405,10 @@ int config_read(char *file) {
if(!strncmp(ZLIB_VERSION,"0.",2) || if(!strncmp(ZLIB_VERSION,"0.",2) ||
!strncmp(ZLIB_VERSION,"1.0",3) || !strncmp(ZLIB_VERSION,"1.0",3) ||
!strncmp(ZLIB_VERSION,"1.1",3)) { !strncmp(ZLIB_VERSION,"1.1",3)) {
if(config.compress) {
config.compress=0; 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); 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; return err;