diff options
Diffstat (limited to 'src/ConfigFile.cxx')
-rw-r--r-- | src/ConfigFile.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ConfigFile.cxx b/src/ConfigFile.cxx index 614bb4f91..02a705f43 100644 --- a/src/ConfigFile.cxx +++ b/src/ConfigFile.cxx @@ -27,6 +27,7 @@ extern "C" { } #include "fs/Path.hxx" +#include "fs/FileSystem.hxx" #include "mpd_error.h" #include <glib.h> @@ -347,20 +348,23 @@ config_read_block(FILE *fp, int *count, char *string, GError **error_r) } bool -config_read_file(const char *file, GError **error_r) +ReadConfigFile(const Path &path, GError **error_r) { + assert(!path.IsNull()); + const std::string path_utf8 = path.ToUTF8(); + FILE *fp; char string[MAX_STRING_SIZE + 1]; int count = 0; struct config_entry *entry; struct config_param *param; - g_debug("loading file %s", file); + g_debug("loading file %s", path_utf8.c_str()); - if (!(fp = fopen(file, "r"))) { + if (!(fp = FOpen(path, "r"))) { g_set_error(error_r, config_quark(), errno, "Failed to open %s: %s", - file, g_strerror(errno)); + path_utf8.c_str(), g_strerror(errno)); return false; } |