aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/fstat.cpp
diff options
context:
space:
mode:
authorMaxim Yurchuk <maxim-yurchuk@ydb.tech>2024-11-20 17:37:57 +0000
committerGitHub <noreply@github.com>2024-11-20 17:37:57 +0000
commitf76323e9b295c15751e51e3443aa47a36bee8023 (patch)
tree4113c8cad473a33e0f746966e0cf087252fa1d7a /util/system/fstat.cpp
parent753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff)
parenta7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff)
downloadydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'util/system/fstat.cpp')
-rw-r--r--util/system/fstat.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/util/system/fstat.cpp b/util/system/fstat.cpp
index cfc5bed323..55d95463cf 100644
--- a/util/system/fstat.cpp
+++ b/util/system/fstat.cpp
@@ -44,8 +44,9 @@ static ui32 GetWinFileType(DWORD fileAttributes, ULONG reparseTag) {
static ui32 GetFileMode(DWORD fileAttributes, ULONG reparseTag) {
ui32 mode = 0;
- if (fileAttributes == 0xFFFFFFFF)
+ if (fileAttributes == 0xFFFFFFFF) {
return mode;
+ }
mode |= GetWinFileType(fileAttributes, reparseTag);
@@ -229,8 +230,9 @@ bool TFileStat::IsSymlink() const noexcept {
i64 GetFileLength(FHANDLE fd) {
#if defined(_win_)
LARGE_INTEGER pos;
- if (!::GetFileSizeEx(fd, &pos))
+ if (!::GetFileSizeEx(fd, &pos)) {
return -1L;
+ }
return pos.QuadPart;
#elif defined(_unix_)
struct stat statbuf;
@@ -252,8 +254,9 @@ i64 GetFileLength(const char* name) {
#if defined(_win_)
WIN32_FIND_DATA fData;
HANDLE h = FindFirstFileA(name, &fData);
- if (h == INVALID_HANDLE_VALUE)
+ if (h == INVALID_HANDLE_VALUE) {
return -1;
+ }
FindClose(h);
return (((i64)fData.nFileSizeHigh) * (i64(MAXDWORD) + 1)) + (i64)fData.nFileSizeLow;
#elif defined(_unix_)