minor lint oriented refactor, moved a couple of functions to aux

This commit is contained in:
Alden Torres 2019-03-10 16:50:55 -04:00 committed by Arvid Norberg
parent 381d5a3c5d
commit 1fe763483e
4 changed files with 9 additions and 3 deletions

View File

@ -4,7 +4,7 @@ branches:
- master
- RC_1_2
- RC_1_1
os: Visual Studio 2015
image: Visual Studio 2015
clone_depth: 1
environment:
matrix:

View File

@ -465,8 +465,11 @@ namespace detail {
}
#endif // TORRENT_ABI_VERSION
namespace aux {
TORRENT_EXTRA_EXPORT file_flags_t get_file_attributes(std::string const& p);
TORRENT_EXTRA_EXPORT std::string get_symlink_path(std::string const& p);
}
}
#endif

View File

@ -170,6 +170,8 @@ namespace {
} // anonymous namespace
namespace aux {
file_flags_t get_file_attributes(std::string const& p)
{
auto const path = convert_to_native_path_string(p);
@ -181,7 +183,7 @@ namespace {
if (attr.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) return file_storage::flag_hidden;
return {};
#else
struct ::stat s;
struct ::stat s{};
if (::lstat(path.c_str(), &s) < 0) return {};
file_flags_t file_attr = {};
if (s.st_mode & S_IXUSR)
@ -202,6 +204,7 @@ namespace {
#endif
}
} // anonymous aux
#if TORRENT_ABI_VERSION == 1

View File

@ -223,7 +223,7 @@ namespace {
// posix version
struct stat ret{};
struct ::stat ret{};
int retval;
if (flags & dont_follow_links)
retval = ::lstat(f.c_str(), &ret);