winfsp unit tests and fixes
This commit is contained in:
@@ -33,7 +33,7 @@ namespace {
|
||||
file_size = 0U;
|
||||
|
||||
#if defined(_WIN32)
|
||||
struct _stat64 st {};
|
||||
struct _stat64 st{};
|
||||
auto res = _stat64(std::string{path}.c_str(), &st);
|
||||
if (res != 0) {
|
||||
return false;
|
||||
@@ -55,7 +55,7 @@ namespace {
|
||||
return ((::PathFileExistsA(abs_path.c_str()) != 0) &&
|
||||
(::PathIsDirectoryA(abs_path.c_str()) == 0));
|
||||
#else // !defined(_WIN32)
|
||||
struct stat64 st {};
|
||||
struct stat64 st{};
|
||||
return (stat64(abs_path.c_str(), &st) == 0 && not S_ISDIR(st.st_mode));
|
||||
#endif // defined(_WIN32)
|
||||
}
|
||||
@@ -70,12 +70,12 @@ namespace repertory::utils::file {
|
||||
// std::string path;
|
||||
//
|
||||
// #if defined(_WIN32)
|
||||
// path.resize(repertory::max_path_length + 1);
|
||||
// path.resize(repertory::max_path_length + 1U);
|
||||
// ::GetFinalPathNameByHandleA(handle, path.data(),
|
||||
// static_cast<DWORD>(path.size()),
|
||||
// FILE_NAME_NORMALIZED | VOLUME_NAME_DOS);
|
||||
// #else // !defined(_WIN32)
|
||||
// path.resize(repertory::max_path_length + 1);
|
||||
// path.resize(repertory::max_path_length + 1U);
|
||||
//
|
||||
// #if defined(__APPLE__)
|
||||
// fcntl(handle, F_GETPATH, source_path.data());
|
||||
@@ -155,8 +155,8 @@ auto file::open_file(std::string_view path, bool read_only) -> fs_file_t {
|
||||
return new_file;
|
||||
}
|
||||
|
||||
auto file::open_or_create_file(std::string_view path,
|
||||
bool read_only) -> fs_file_t {
|
||||
auto file::open_or_create_file(std::string_view path, bool read_only)
|
||||
-> fs_file_t {
|
||||
auto abs_path = utils::path::absolute(path);
|
||||
if (not is_file(abs_path)) {
|
||||
#if defined(_WIN32)
|
||||
|
||||
Reference in New Issue
Block a user