summaryrefslogtreecommitdiff
path: root/zen/file_access.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-07-24 15:08:16 -0400
committerB. Stack <bgstack15@gmail.com>2023-07-24 15:08:16 -0400
commit69e12f5bd10459ff7c239b82519107ae2a755bc0 (patch)
tree8b22393241df7e46686c9426140582bd747a6d5a /zen/file_access.cpp
parentadd upstream 12.4 (diff)
downloadFreeFileSync-69e12f5bd10459ff7c239b82519107ae2a755bc0.tar.gz
FreeFileSync-69e12f5bd10459ff7c239b82519107ae2a755bc0.tar.bz2
FreeFileSync-69e12f5bd10459ff7c239b82519107ae2a755bc0.zip
add upstream 12.5
Diffstat (limited to 'zen/file_access.cpp')
-rw-r--r--zen/file_access.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/zen/file_access.cpp b/zen/file_access.cpp
index 6c47936c..4ce66acf 100644
--- a/zen/file_access.cpp
+++ b/zen/file_access.cpp
@@ -622,9 +622,8 @@ void zen::copySymlink(const Zstring& sourcePath, const Zstring& targetPath) //th
}
//allow only consistent objects to be created -> don't place before ::symlink(); targetPath may already exist!
- ZEN_ON_SCOPE_FAIL(try { removeSymlinkPlain(targetPath); /*throw FileError*/ }
- catch (FileError&) {});
- warn_static("log it!")
+ ZEN_ON_SCOPE_FAIL(try { removeSymlinkPlain(targetPath); }
+ catch (const FileError& e) { logExtraError(e.toString()); });
//file times: essential for syncing a symlink: enforce this! (don't just try!)
struct stat sourceInfo = {};
@@ -665,7 +664,7 @@ FileCopyResult zen::copyNewFile(const Zstring& sourceFile, const Zstring& target
}
FileOutputPlain fileOut(fdTarget, targetFile); //pass ownership
- //preallocate disk space + reduce fragmentation
+ //preallocate disk space + reduce fragmentation
fileOut.reserveSpace(sourceInfo.st_size); //throw FileError
unbufferedStreamCopy([&](void* buffer, size_t bytesToRead)
@@ -684,7 +683,7 @@ FileCopyResult zen::copyNewFile(const Zstring& sourceFile, const Zstring& target
},
fileOut.getBlockSize() /*throw FileError*/); //throw FileError, X
- //possible improvement: copy_file_range() performs an in-kernel copy: https://github.com/coreutils/coreutils/blob/17479ef60c8edbd2fe8664e31a7f69704f0cd221/src/copy.c#L342
+ //possible improvement: copy_file_range() performs an in-kernel copy: https://github.com/coreutils/coreutils/blob/17479ef60c8edbd2fe8664e31a7f69704f0cd221/src/copy.c#L342
#if 0
//clean file system cache: needed at all? no user complaints at all so far!!!
bgstack15