ClientFile: use Path and file system API, update usages accordingly

This commit also fixes incorrect passing of UTF-8 strings to client_allow_file
This commit is contained in:
Denis Krjuchkov
2013-05-05 15:42:29 +06:00
parent 459d824c50
commit a688745bdc
4 changed files with 36 additions and 10 deletions

View File

@@ -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;
}