aboutsummaryrefslogtreecommitdiff
path: root/zenstore/basicfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenstore/basicfile.cpp')
-rw-r--r--zenstore/basicfile.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp
index 3edfc15ee..80d9a2204 100644
--- a/zenstore/basicfile.cpp
+++ b/zenstore/basicfile.cpp
@@ -74,7 +74,7 @@ BasicFile::Open(std::filesystem::path FileName, bool IsCreate, std::error_code&
}
#else
int OpenFlags = O_RDWR;
- OpenFlags |= IsCreate ? O_CREAT|O_TRUNC : 0;
+ OpenFlags |= IsCreate ? O_CREAT | O_TRUNC : 0;
int Fd = open(FileName.c_str(), OpenFlags, 0666);
if (Fd < 0)
@@ -125,9 +125,9 @@ BasicFile::Read(void* Data, uint64_t BytesToRead, uint64_t FileOffset)
ZEN_ASSERT(dwNumberOfBytesRead == NumberOfBytesToRead);
#else
static_assert(sizeof(off_t) >= sizeof(uint64_t), "sizeof(off_t) does not support large files");
- int Fd = int(uintptr_t(m_FileHandle));
- int BytesRead = pread(Fd, Data, NumberOfBytesToRead, FileOffset);
- bool Success = (BytesRead > 0);
+ int Fd = int(uintptr_t(m_FileHandle));
+ int BytesRead = pread(Fd, Data, NumberOfBytesToRead, FileOffset);
+ bool Success = (BytesRead > 0);
#endif
if (!Success)
@@ -206,9 +206,9 @@ BasicFile::Write(const void* Data, uint64_t Size, uint64_t FileOffset, std::erro
BOOL Success = ::WriteFile(m_FileHandle, Data, DWORD(NumberOfBytesToWrite), &dwNumberOfBytesWritten, &Ovl);
#else
static_assert(sizeof(off_t) >= sizeof(uint64_t), "sizeof(off_t) does not support large files");
- int Fd = int(uintptr_t(m_FileHandle));
- int BytesWritten = pwrite(Fd, Data, NumberOfBytesToWrite, FileOffset);
- bool Success = (BytesWritten > 0);
+ int Fd = int(uintptr_t(m_FileHandle));
+ int BytesWritten = pwrite(Fd, Data, NumberOfBytesToWrite, FileOffset);
+ bool Success = (BytesWritten > 0);
#endif
if (!Success)
@@ -336,7 +336,7 @@ LockFile::~LockFile()
{
#if ZEN_PLATFORM_LINUX
int Fd = int(intptr_t(m_FileHandle));
- flock(Fd, LOCK_UN|LOCK_NB);
+ flock(Fd, LOCK_UN | LOCK_NB);
#elif ZEN_PLATFORM_MAC
# error check flock() support
#endif
@@ -369,14 +369,14 @@ LockFile::Create(std::filesystem::path FileName, CbObject Payload, std::error_co
return;
}
#elif ZEN_PLATFORM_LINUX
- int Fd = open(FileName.c_str(), O_RDWR|O_CREAT, 0666);
+ int Fd = open(FileName.c_str(), O_RDWR | O_CREAT, 0666);
if (Fd < 0)
{
Ec = zen::MakeErrorCodeFromLastError();
return;
}
- int LockRet = flock(Fd, LOCK_EX|LOCK_NB);
+ int LockRet = flock(Fd, LOCK_EX | LOCK_NB);
if (LockRet < 0)
{
Ec = zen::MakeErrorCodeFromLastError();