mirror of
https://github.com/trapexit/mergerfs.git
synced 2024-04-21 12:31:43 +00:00
revert removal of 'all' policy and relevant behavior. closes #54
This commit is contained in:
+13
-5
@@ -40,20 +40,28 @@ using std::vector;
|
||||
|
||||
static
|
||||
int
|
||||
_unlink(const fs::SearchFunc searchFunc,
|
||||
_unlink(const fs::find::Func actionFunc,
|
||||
const vector<string> &srcmounts,
|
||||
const string &fusepath)
|
||||
{
|
||||
int rv;
|
||||
fs::Path path;
|
||||
int error;
|
||||
fs::Paths paths;
|
||||
|
||||
rv = searchFunc(srcmounts,fusepath,path);
|
||||
rv = actionFunc(srcmounts,fusepath,paths,-1);
|
||||
if(rv == -1)
|
||||
return -errno;
|
||||
|
||||
rv = ::unlink(path.full.c_str());
|
||||
error = 0;
|
||||
for(fs::Paths::const_iterator
|
||||
i = paths.begin(), ei = paths.end(); i != ei; ++i)
|
||||
{
|
||||
rv = ::unlink(i->full.c_str());
|
||||
if(rv == -1)
|
||||
error = errno;
|
||||
}
|
||||
|
||||
return ((rv == -1) ? -errno : 0);
|
||||
return -error;
|
||||
}
|
||||
|
||||
namespace mergerfs
|
||||
|
||||
Reference in New Issue
Block a user