put abort functionality into get_config_path to further reduce code duplication

This commit is contained in:
rofl0r
2012-07-08 23:47:56 +02:00
parent fafeaf5936
commit e5e87c8f22
4 changed files with 14 additions and 18 deletions

View File

@ -95,11 +95,7 @@ int main(int argc, char *argv[]) {
return usage(argv);
/* check if path of config file has not been passed via command line */
if(!path) path = get_config_path(pbuf, sizeof(pbuf));
if(!path) {
perror("couldnt find configuration file");
return 1;
}
path = get_config_path(path, pbuf, sizeof(pbuf));
if(!quiet)
fprintf(stderr, LOG_PREFIX "config file found: %s\n", path);