X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fxattr.c;h=e58dc7ea6587264ab91d133d6d7339002c3f3b96;hb=cb2ec65d5e4a4174b0f24635b971eeb2cdd964ff;hp=c218dea105cc840ab73619f3897e767bd1615ca0;hpb=539bf7e8983c53c4cf79ffa64302bef1585bec31;p=libguestfs.git diff --git a/daemon/xattr.c b/daemon/xattr.c index c218dea..e58dc7e 100644 --- a/daemon/xattr.c +++ b/daemon/xattr.c @@ -24,16 +24,23 @@ #include "../src/guestfs_protocol.h" #include "daemon.h" #include "actions.h" +#include "optgroups.h" #if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_XATTR_H) -#ifdef HAVE_ATTR_XATTR_H -#include -#else -#ifdef HAVE_SYS_XATTR_H -#include -#endif -#endif +# ifdef HAVE_ATTR_XATTR_H +# include +# else +# ifdef HAVE_SYS_XATTR_H +# include +# endif +# endif + +int +optgroup_linuxxattrs_available (void) +{ + return 1; +} static guestfs_int_xattr_list *getxattrs (const char *path, ssize_t (*listxattr) (const char *path, char *list, size_t size), ssize_t (*getxattr) (const char *path, const char *name, void *value, size_t size)); static int _setxattr (const char *xattr, const char *val, int vallen, const char *path, int (*setxattr) (const char *path, const char *name, const void *value, size_t size, int flags)); @@ -442,54 +449,52 @@ do_lxattrlist (const char *path, char *const *names) } #else /* no xattr.h */ +int +optgroup_linuxxattrs_available (void) +{ + return 0; +} guestfs_int_xattr_list * do_getxattrs (const char *path) { - reply_with_error ("getxattrs: no support for xattrs"); - return NULL; + NOT_AVAILABLE (NULL); } guestfs_int_xattr_list * do_lgetxattrs (const char *path) { - reply_with_error ("lgetxattrs: no support for xattrs"); - return NULL; + NOT_AVAILABLE (NULL); } int do_setxattr (const char *xattr, const char *val, int vallen, const char *path) { - reply_with_error ("setxattr: no support for xattrs"); - return -1; + NOT_AVAILABLE (-1); } int do_lsetxattr (const char *xattr, const char *val, int vallen, const char *path) { - reply_with_error ("lsetxattr: no support for xattrs"); - return -1; + NOT_AVAILABLE (-1); } int do_removexattr (const char *xattr, const char *path) { - reply_with_error ("removexattr: no support for xattrs"); - return -1; + NOT_AVAILABLE (-1); } int do_lremovexattr (const char *xattr, const char *path) { - reply_with_error ("lremovexattr: no support for xattrs"); - return -1; + NOT_AVAILABLE (-1); } guestfs_int_xattr_list * do_lxattrlist (const char *path, char *const *names) { - reply_with_error ("lxattrlist: no support for xattrs"); - return NULL; + NOT_AVAILABLE (NULL); } #endif /* no xattr.h */