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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user