Browse Source

Clean up some cpp logic for __APPLE__

pull/384/head
Adam Knight 9 years ago
parent
commit
6cfd4d5d7b
  1. 8
      src/fs_base_getxattr.hpp
  2. 8
      src/fs_base_listxattr.hpp
  3. 8
      src/fs_base_removexattr.hpp
  4. 8
      src/fs_base_setxattr.hpp

8
src/fs_base_getxattr.hpp

@ -34,14 +34,12 @@ namespace fs
void *value, void *value,
const size_t size) const size_t size)
{ {
#ifndef WITHOUT_XATTR
#if __APPLE__
#if WITHOUT_XATTR
return (errno=ENOTSUP,-1);
#elif __APPLE__
return ::getxattr(path.c_str(),attrname,value,size,0,XATTR_NOFOLLOW); return ::getxattr(path.c_str(),attrname,value,size,0,XATTR_NOFOLLOW);
#else #else
return ::lgetxattr(path.c_str(),attrname,value,size); return ::lgetxattr(path.c_str(),attrname,value,size);
#endif /* __APPLE__ */
#else
return (errno=ENOTSUP,-1);
#endif #endif
} }
} }

8
src/fs_base_listxattr.hpp

@ -33,14 +33,12 @@ namespace fs
char *list, char *list,
const size_t size) const size_t size)
{ {
#ifndef WITHOUT_XATTR
#if __APPLE__
#ifdef WITHOUT_XATTR
return (errno=ENOTSUP,-1);
#elif __APPLE__
return ::listxattr(path.c_str(),list,size,XATTR_NOFOLLOW); return ::listxattr(path.c_str(),list,size,XATTR_NOFOLLOW);
#else #else
return ::llistxattr(path.c_str(),list,size); return ::llistxattr(path.c_str(),list,size);
#endif /* __APPLE__ */
#else
return (errno=ENOTSUP,-1);
#endif #endif
} }
} }

8
src/fs_base_removexattr.hpp

@ -32,14 +32,12 @@ namespace fs
lremovexattr(const std::string &path, lremovexattr(const std::string &path,
const char *attrname) const char *attrname)
{ {
#ifndef WITHOUT_XATTR
#if __APPLE__
#if WITHOUT_XATTR
return (errno=ENOTSUP,-1);
#elif __APPLE__
return ::removexattr(path.c_str(),attrname,XATTR_NOFOLLOW); return ::removexattr(path.c_str(),attrname,XATTR_NOFOLLOW);
#else #else
return ::lremovexattr(path.c_str(),attrname); return ::lremovexattr(path.c_str(),attrname);
#endif /* __APPLE__ */
#else
return (errno=ENOTSUP,-1);
#endif #endif
} }
} }

8
src/fs_base_setxattr.hpp

@ -35,14 +35,12 @@ namespace fs
const size_t size, const size_t size,
const int flags) const int flags)
{ {
#ifndef WITHOUT_XATTR
#if __APPLE__
#if WITHOUT_XATTR
return (errno=ENOTSUP,-1);
#elif __APPLE__
return ::setxattr(path.c_str(),name,value,size,0,flags); return ::setxattr(path.c_str(),name,value,size,0,flags);
#else #else
return ::lsetxattr(path.c_str(),name,value,size,flags); return ::lsetxattr(path.c_str(),name,value,size,flags);
#endif /* __APPLE__ */
#else
return (errno=ENOTSUP,-1);
#endif #endif
} }
} }

Loading…
Cancel
Save