rework some function error handling

chmod, chown, removexattr, setxattr, truncate, utimens:
* if no errors: return 0
* if no successes: return first error
* if file acted on was the same as related search function: return its value
* return 0

rmdir, unlink:
* if no errors: return 0
* return first error
This commit is contained in:
Antonio SJ Musumeci 2020-09-13 00:25:24 -04:00
parent 24f03b04eb
commit 5a3184359d
14 changed files with 492 additions and 167 deletions

View file

@ -20,7 +20,6 @@
#include "fs_clonepath.hpp"
#include "fs_mkdir.hpp"
#include "fs_path.hpp"
#include "rv.hpp"
#include "ugid.hpp"
#include <fuse.h>
@ -31,6 +30,26 @@
using std::string;
using std::vector;
namespace error
{
static
inline
int
calc(const int rv_,
const int prev_,
const int cur_)
{
if(rv_ == -1)
{
if(prev_ == 0)
return 0;
return cur_;
}
return 0;
}
}
namespace l
{
static