Browse Source

restructure error calculation

pull/361/head
Antonio SJ Musumeci 8 years ago
parent
commit
726b88e039
  1. 2
      src/chmod.cpp
  2. 2
      src/chown.cpp
  3. 4
      src/link.cpp
  4. 2
      src/mkdir.cpp
  5. 2
      src/mknod.cpp
  6. 2
      src/removexattr.cpp
  7. 4
      src/rename.cpp
  8. 2
      src/rmdir.cpp
  9. 5
      src/rv.hpp
  10. 2
      src/setxattr.cpp
  11. 2
      src/symlink.cpp
  12. 2
      src/truncate.cpp
  13. 2
      src/unlink.cpp
  14. 2
      src/utimens.cpp

2
src/chmod.cpp

@ -45,7 +45,7 @@ _chmod_loop_core(const string *basepath,
rv = fs::chmod(fullpath,mode);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

2
src/chown.cpp

@ -47,7 +47,7 @@ _chown_loop_core(const string *basepath,
rv = fs::lchown(fullpath,uid,gid);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

4
src/link.cpp

@ -59,7 +59,7 @@ _link_create_path_core(const string &oldbasepath,
rv = fs::link(oldfullpath,newfullpath);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static
@ -176,7 +176,7 @@ _link_preserve_path_core(Policy::Func::Search searchFunc,
rv = fs::link(oldfullpath,newfullpath);
}
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

2
src/mkdir.cpp

@ -71,7 +71,7 @@ _mkdir_loop_core(const string &existingpath,
rv = _mkdir_core(fullpath,mode,umask);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

2
src/mknod.cpp

@ -73,7 +73,7 @@ _mknod_loop_core(const string &existingpath,
rv = _mknod_core(fullpath,mode,umask,dev);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

2
src/removexattr.cpp

@ -45,7 +45,7 @@ _removexattr_loop_core(const string *basepath,
rv = fs::lremovexattr(fullpath,attrname);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

4
src/rename.cpp

@ -103,7 +103,7 @@ _rename_create_path_core(const vector<const string*> &oldbasepaths,
rv = _rename(oldbasepath,oldfullpath,
newbasepath,newfusedirpath,newfullpath);
error = calc_error(rv,error,errno);
error = error::calc(rv,error,errno);
if(RENAME_FAILED(rv))
tounlink.push_back(oldfullpath);
}
@ -241,7 +241,7 @@ _rename_preserve_path_core(Policy::Func::Search searchFunc,
rv = fs::rename(oldfullpath,newfullpath);
}
error = calc_error(rv,error,errno);
error = error::calc(rv,error,errno);
if(RENAME_FAILED(rv))
toremove.push_back(oldfullpath);
}

2
src/rmdir.cpp

@ -45,7 +45,7 @@ _rmdir_loop_core(const string *basepath,
rv = fs::rmdir(fullpath);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}

5
src/rv.hpp

@ -17,10 +17,12 @@
#ifndef __RV_HPP__
#define __RV_HPP__
namespace error
{
static
inline
int
calc_error(const int rv,
calc(const int rv,
const int prev,
const int cur)
{
@ -33,5 +35,6 @@ calc_error(const int rv,
return 0;
}
}
#endif // __RV_HPP__

2
src/setxattr.cpp

@ -303,7 +303,7 @@ _setxattr_loop_core(const string *basepath,
rv = fs::lsetxattr(fullpath,attrname,attrval,attrvalsize,flags);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

2
src/symlink.cpp

@ -58,7 +58,7 @@ _symlink_loop_core(const string &existingpath,
rv = ::symlink(oldpath,fullnewpath.c_str());
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

2
src/truncate.cpp

@ -48,7 +48,7 @@ _truncate_loop_core(const string *basepath,
rv = fs::truncate(fullpath,size);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

2
src/unlink.cpp

@ -46,7 +46,7 @@ _unlink_loop_core(const string *basepath,
rv = fs::unlink(fullpath);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

2
src/utimens.cpp

@ -47,7 +47,7 @@ _utimens_loop_core(const string *basepath,
rv = fs::lutime(fullpath,ts);
return calc_error(rv,error,errno);
return error::calc(rv,error,errno);
}
static

Loading…
Cancel
Save