diff options
Diffstat (limited to 'libglusterfs/src/compat.c')
-rw-r--r-- | libglusterfs/src/compat.c | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/libglusterfs/src/compat.c b/libglusterfs/src/compat.c index 85af45f9a..891b156d3 100644 --- a/libglusterfs/src/compat.c +++ b/libglusterfs/src/compat.c @@ -36,92 +36,6 @@ #include "compat.h" #include "common-utils.h" -#ifdef GF_DARWIN_HOST_OS - -#define GF_FINDER_INFO_XATTR "com.apple.FinderInfo" -#define GF_RESOURCE_FORK_XATTR "com.apple.ResourceFork" -#define GF_FINDER_INFO_SIZE 32 - -static const char gf_finder_info_content[GF_FINDER_INFO_SIZE] = { - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -}; - - -int32_t -gf_darwin_compat_listxattr (int len, dict_t *dict, int size) -{ - data_t *data = NULL; - if (len == -1) - len = 0; - - data = dict_get (dict, GF_FINDER_INFO_XATTR); - if (!data) { - dict_set (dict, GF_FINDER_INFO_XATTR, - bin_to_data ((void *)gf_finder_info_content, - GF_FINDER_INFO_SIZE)); - len += strlen (GF_FINDER_INFO_XATTR); - } - - data = dict_get (dict, GF_RESOURCE_FORK_XATTR); - if (!data) { - dict_set (dict, GF_RESOURCE_FORK_XATTR, str_to_data ("")); - len += strlen (GF_RESOURCE_FORK_XATTR); - } - - return len; -} - -int32_t -gf_darwin_compat_getxattr (const char *key, dict_t *dict) -{ - data_t *data = NULL; - - if (strcmp(key, GF_FINDER_INFO_XATTR) == 0) { - data = dict_get (dict, GF_FINDER_INFO_XATTR); - if (!data) { - dict_set (dict, GF_FINDER_INFO_XATTR, - bin_to_data ((void *)gf_finder_info_content, - GF_FINDER_INFO_SIZE)); - return GF_FINDER_INFO_SIZE; - } - return 0; - } - - if (strcmp(key, GF_RESOURCE_FORK_XATTR) == 0) { - data = dict_get (dict, GF_RESOURCE_FORK_XATTR); - if (!data) { - /* Always null */ - dict_set (dict, GF_RESOURCE_FORK_XATTR, - str_to_data ("")); - return 0; - } - return 0; - } - return -1; -} - - -int32_t -gf_darwin_compat_setxattr (dict_t *dict) -{ - data_t *data = NULL; - - data = dict_get (dict, GF_FINDER_INFO_XATTR); - if (data) - return 0; - data = dict_get (dict, GF_RESOURCE_FORK_XATTR); - if (data) - return 0; - - return -1; -} - -#endif /* DARWIN */ - - #ifdef GF_SOLARIS_HOST_OS int |