diff --git a/src/conf.c b/src/conf.c index 77b08d0..7624b47 100644 --- a/src/conf.c +++ b/src/conf.c @@ -779,23 +779,3 @@ int conf_parse_file_f(struct conf_option *opts, size_t len, free(path); return ret; } - -int conf_parse_standard_files(struct conf_option *opts, size_t len, - const char *fname) -{ - int ret; - const char *home; - - ret = conf_parse_file_f(opts, len, "/etc/%s.conf", fname); - if (ret) - return ret; - - home = getenv("HOME"); - if (home) { - ret = conf_parse_file_f(opts, len, "%s/.%s.conf", home, fname); - if (ret) - return ret; - } - - return 0; -} diff --git a/src/conf.h b/src/conf.h index 8d194fe..9982f71 100644 --- a/src/conf.h +++ b/src/conf.h @@ -171,7 +171,5 @@ int conf_parse_argv(struct conf_option *opts, size_t len, int conf_parse_file(struct conf_option *opts, size_t len, const char *path); int conf_parse_file_f(struct conf_option *opts, size_t len, const char *format, ...); -int conf_parse_standard_files(struct conf_option *opts, size_t len, - const char *fname); #endif /* CONFIG_CONFIG_H */ diff --git a/src/kmscon_conf.c b/src/kmscon_conf.c index db7d817..3e1109f 100644 --- a/src/kmscon_conf.c +++ b/src/kmscon_conf.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "conf.h" #include "kmscon_conf.h" @@ -344,10 +345,18 @@ int kmscon_load_config(int argc, char **argv) log_print_init("kmscon"); - ret = conf_parse_standard_files(options, onum, "kmscon"); + ret = conf_parse_file_f(options, onum, "/etc/kmscon/kmscon.conf"); if (ret) return ret; + /* TODO: Deprecated! Remove this! */ + if (!access("/etc/kmscon.conf", F_OK)) { + log_error("/etc/kmscon.conf is deprecated, please use /etc/kmscon/kmscon.conf"); + ret = conf_parse_file_f(options, onum, "/etc/kmscon.conf"); + if (ret) + return ret; + } + return 0; }