aboutsummaryrefslogtreecommitdiff
path: root/src/ConfigFile.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-29 17:23:35 +0100
committerMax Kellermann <max@duempel.org>2013-01-29 18:09:39 +0100
commitfeb8d5b82f3e7c67806d5efbef1e0b86170ec6dd (patch)
tree8127b30bc339eae03226f3e97ea8ac99f62587b3 /src/ConfigFile.cxx
parenteb8922f3468fe664211911c49077a4e3442b7703 (diff)
ConfigFile, CommandLine: use the Path class
Diffstat (limited to 'src/ConfigFile.cxx')
-rw-r--r--src/ConfigFile.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ConfigFile.cxx b/src/ConfigFile.cxx
index 614bb4f9..02a705f4 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;
}