mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
find functions now return errors. closes #24
This commit is contained in:
parent
8f35406000
commit
cfe7609bcd
21 changed files with 123 additions and 111 deletions
|
|
@ -54,19 +54,20 @@ _create(const fs::SearchFunc searchFunc,
|
|||
uint64_t &fh)
|
||||
{
|
||||
int fd;
|
||||
int rv;
|
||||
string path;
|
||||
string dirname;
|
||||
fs::PathVector createpath;
|
||||
fs::PathVector existingpath;
|
||||
|
||||
dirname = fs::dirname(fusepath);
|
||||
searchFunc(srcmounts,dirname,existingpath);
|
||||
if(existingpath.empty())
|
||||
return -ENOENT;
|
||||
rv = searchFunc(srcmounts,dirname,existingpath);
|
||||
if(rv == -1)
|
||||
return -errno;
|
||||
|
||||
createPathFunc(srcmounts,dirname,createpath);
|
||||
if(createpath.empty())
|
||||
return -ENOSPC;
|
||||
rv = createPathFunc(srcmounts,dirname,createpath);
|
||||
if(rv == -1)
|
||||
return -errno;
|
||||
|
||||
if(createpath[0].base != existingpath[0].base)
|
||||
fs::clonepath(existingpath[0].base,createpath[0].base,dirname);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue