mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-21 23:46:26 -05:00
Better same file check for fsck
This commit is contained in:
parent
1a8eb326af
commit
06097b3723
3 changed files with 66 additions and 3 deletions
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "fs_close.hpp"
|
||||
#include "fs_copyfile.hpp"
|
||||
#include "fs_is_same_file.hpp"
|
||||
#include "fs_lchmod.hpp"
|
||||
#include "fs_lchown.hpp"
|
||||
#include "fs_lgetxattr.hpp"
|
||||
|
|
@ -246,10 +247,10 @@ _copy_files(const std::string &src_,
|
|||
{
|
||||
int rv;
|
||||
|
||||
// TODO: Additional protection to confirm not the literal same
|
||||
// file. fs::is_same_file(src,dst);
|
||||
if(src_ == dst.path)
|
||||
continue;
|
||||
if(fs::is_same_file(src_,dst.path) == 1)
|
||||
continue;
|
||||
|
||||
rv = fs::copyfile(src_,dst.path,{.cleanup_failure=false});
|
||||
if(rv < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue