improve evilbsd support

Netbsd hi
This commit is contained in:
komaruworld committed 2026-10-09 00:45:05 +03:00
1 parent cb2e9dd598
commit 74eedada0b
1 file changed
+4 -1
+4 -1
View File
@@ -297,7 +297,10 @@ bool CloneOrCopyFile(const std::filesystem::path& source,
}
bool copied = false;
#if defined(__linux__) && defined(FICLONE)
copied = ioctl(output, FICLONE, input) == 0;
struct stat cloned_metadata = {};
copied = ioctl(output, FICLONE, input) == 0 &&
fstat(output, &cloned_metadata) == 0 &&
cloned_metadata.st_size == metadata.st_size;
#endif
#if defined(__linux__)
if (!copied) {