mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-29 03:16:56 -05:00
rework policy code
This commit is contained in:
parent
345d0bbdc4
commit
aab90b0503
35 changed files with 983 additions and 991 deletions
|
|
@ -43,15 +43,15 @@ _symlink(const vector<string> &srcmounts,
|
|||
const string to)
|
||||
{
|
||||
int rv;
|
||||
fs::Path path;
|
||||
fs::PathVector paths;
|
||||
|
||||
path = fs::find_first(srcmounts,fs::dirname(to));
|
||||
if(path.base.empty())
|
||||
fs::find::ff(srcmounts,fs::dirname(to),paths);
|
||||
if(paths.empty())
|
||||
return -ENOENT;
|
||||
|
||||
path.full = fs::make_path(path.base,to);
|
||||
paths[0].full = fs::make_path(paths[0].base,to);
|
||||
|
||||
rv = symlink(from.c_str(),path.full.c_str());
|
||||
rv = symlink(from.c_str(),paths[0].full.c_str());
|
||||
|
||||
return ((rv == -1) ? -errno : 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue