mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-30 11:56:31 -05:00
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:
parent
24f03b04eb
commit
5a3184359d
14 changed files with 492 additions and 167 deletions
|
|
@ -16,9 +16,8 @@
|
|||
|
||||
#include "config.hpp"
|
||||
#include "errno.hpp"
|
||||
#include "fs_unlink.hpp"
|
||||
#include "fs_path.hpp"
|
||||
#include "rv.hpp"
|
||||
#include "fs_unlink.hpp"
|
||||
#include "ugid.hpp"
|
||||
|
||||
#include <fuse.h>
|
||||
|
|
@ -31,6 +30,24 @@
|
|||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
|
||||
namespace error
|
||||
{
|
||||
static
|
||||
inline
|
||||
int
|
||||
calc(const int rv_,
|
||||
const int prev_,
|
||||
const int cur_)
|
||||
{
|
||||
if(prev_ != 0)
|
||||
return prev_;
|
||||
if(rv_ == -1)
|
||||
return cur_;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
namespace l
|
||||
{
|
||||
static
|
||||
|
|
@ -56,7 +73,7 @@ namespace l
|
|||
{
|
||||
int error;
|
||||
|
||||
error = -1;
|
||||
error = 0;
|
||||
for(size_t i = 0, ei = basepaths_.size(); i != ei; i++)
|
||||
{
|
||||
error = l::unlink_loop_core(basepaths_[i],fusepath_,error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue