aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/fstat.cpp
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-11-20 11:14:58 +0000
committerAlexander Smirnov <alex@ydb.tech>2024-11-20 11:14:58 +0000
commit31773f157bf8164364649b5f470f52dece0a4317 (patch)
tree33d0f7eef45303ab68cf08ab381ce5e5e36c5240 /util/system/fstat.cpp
parent2c7938962d8689e175574fc1e817c05049f27905 (diff)
parenteff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff)
downloadydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz
Merge branch 'rightlib' into mergelibs-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_)