diff options
author | Denis Krjuchkov <denis@crazydev.net> | 2013-05-05 15:42:29 +0600 |
---|---|---|
committer | Denis Krjuchkov <denis@crazydev.net> | 2013-05-06 23:36:36 +0600 |
commit | a688745bdc6db32e2cb7765c5d113958dcd49411 (patch) | |
tree | 4e0ba55771d6552ae02ff29af9c57a6a265bffcf /src/ClientFile.cxx | |
parent | 459d824c50b3ef444f0b94cc60bcbec83addf801 (diff) | |
download | mpd-a688745bdc6db32e2cb7765c5d113958dcd49411.tar.gz mpd-a688745bdc6db32e2cb7765c5d113958dcd49411.tar.xz mpd-a688745bdc6db32e2cb7765c5d113958dcd49411.zip |
ClientFile: use Path and file system API, update usages accordingly
This commit also fixes incorrect passing of UTF-8 strings to client_allow_file
Diffstat (limited to '')
-rw-r--r-- | src/ClientFile.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ClientFile.cxx b/src/ClientFile.cxx index dccf0a327..07fa767b0 100644 --- a/src/ClientFile.cxx +++ b/src/ClientFile.cxx @@ -22,6 +22,8 @@ #include "Client.hxx" #include "ack.h" #include "io_error.h" +#include "fs/Path.hxx" +#include "fs/FileSystem.hxx" #include <sys/stat.h> #include <sys/types.h> @@ -29,7 +31,7 @@ #include <unistd.h> bool -client_allow_file(const Client *client, const char *path_fs, +client_allow_file(const Client *client, const Path &path_fs, GError **error_r) { #ifdef WIN32 @@ -54,7 +56,7 @@ client_allow_file(const Client *client, const char *path_fs, } struct stat st; - if (stat(path_fs, &st) < 0) { + if (!StatFile(path_fs, st)) { set_error_errno(error_r); return false; } |