From a688745bdc6db32e2cb7765c5d113958dcd49411 Mon Sep 17 00:00:00 2001 From: Denis Krjuchkov Date: Sun, 5 May 2013 15:42:29 +0600 Subject: ClientFile: use Path and file system API, update usages accordingly This commit also fixes incorrect passing of UTF-8 strings to client_allow_file --- src/ClientFile.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ClientFile.cxx') 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 #include @@ -29,7 +31,7 @@ #include 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; } -- cgit v1.2.3