mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-25 01:16:30 -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
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue