revert removal of 'all' policy and relevant behavior. closes #54

This commit is contained in:
Antonio SJ Musumeci
2015-03-05 21:01:22 -05:00
parent a359c88173
commit c022741ffb
28 changed files with 454 additions and 225 deletions
+13 -5
View File
@@ -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