mirror of
https://github.com/trapexit/mergerfs.git
synced 2024-04-21 12:31:43 +00:00
return clonepath errors
currently the error is ignored and it was expected the primary call would fail. problem is it returns confusing errors as a result. (eg ENOENT vs EPERM)
This commit is contained in:
+7
-5
@@ -43,22 +43,24 @@ _create_core(const string &existingpath,
|
||||
const int flags,
|
||||
uint64_t &fh)
|
||||
{
|
||||
int fd;
|
||||
int rv;
|
||||
string fullpath;
|
||||
|
||||
if(createpath != existingpath)
|
||||
{
|
||||
const ugid::SetRootGuard ugidGuard;
|
||||
fs::clonepath(existingpath,createpath,fusedirpath);
|
||||
rv = fs::clonepath(existingpath,createpath,fusedirpath);
|
||||
if(rv == -1)
|
||||
return -errno;
|
||||
}
|
||||
|
||||
fs::path::make(&createpath,fusepath,fullpath);
|
||||
|
||||
fd = fs::open(fullpath,flags,mode);
|
||||
if(fd == -1)
|
||||
rv = fs::open(fullpath,flags,mode);
|
||||
if(rv == -1)
|
||||
return -errno;
|
||||
|
||||
fh = reinterpret_cast<uint64_t>(new FileInfo(fd));
|
||||
fh = reinterpret_cast<uint64_t>(new FileInfo(rv));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user