summaryrefslogtreecommitdiff
path: root/zen/file_io.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2021-02-02 21:49:34 +0000
committerB Stack <bgstack15@gmail.com>2021-02-02 21:49:34 +0000
commit26b8bd6eb07b78adad36049e03494a2931b231af (patch)
tree4d7c950512836f473a6a8cbb521c61e800db6584 /zen/file_io.cpp
parentMerge branch '11.5' into 'master' (diff)
parentadd upstream 11.6 (diff)
downloadFreeFileSync-26b8bd6eb07b78adad36049e03494a2931b231af.tar.gz
FreeFileSync-26b8bd6eb07b78adad36049e03494a2931b231af.tar.bz2
FreeFileSync-26b8bd6eb07b78adad36049e03494a2931b231af.zip
Merge branch '11.6' into 'master'11.6
add upstream 11.6 See merge request opensource-tracking/FreeFileSync!30
Diffstat (limited to 'zen/file_io.cpp')
-rw-r--r--zen/file_io.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/zen/file_io.cpp b/zen/file_io.cpp
index 33c41fbc..e081335d 100644
--- a/zen/file_io.cpp
+++ b/zen/file_io.cpp
@@ -167,7 +167,7 @@ FileBase::FileHandle openHandleForWrite(const Zstring& filePath) //throw FileErr
//checkForUnsupportedType(filePath); -> not needed, open() + O_WRONLY should fail fast
const int fdFile = ::open(filePath.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC | /*access == FileOutput::ACC_OVERWRITE ? O_TRUNC : */ O_EXCL,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); //0666
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); //0666 => umask will be applied implicitly!
if (fdFile == -1)
{
const int ec = errno; //copy before making other system calls!
@@ -296,7 +296,7 @@ void FileOutput::reserveSpace(uint64_t expectedSize) //throw FileError
if (expectedSize < 1024) //https://www.sciencedirect.com/topics/computer-science/master-file-table
return;
- //don't use ::posix_fallocate! horribly inefficient if FS doesn't support it + changes file size
+ //don't use ::posix_fallocate which uses horribly inefficient fallback if FS doesn't support it (EOPNOTSUPP) and changes files size!
//FALLOC_FL_KEEP_SIZE => allocate only, file size is NOT changed!
if (::fallocate(getHandle(), //int fd,
FALLOC_FL_KEEP_SIZE, //int mode,
bgstack15