* Handle errors gracefully.
*/
switch (errno) {
- case ENOSYS:
- case ENOTSUP:
- case EOPNOTSUPP:
+#if defined(BACL_ENOTSUP)
+ case BACL_ENOTSUP:
/**
* If the filesystem reports it doesn't support ACLs we clear the
* BACL_FLAG_SAVE_NATIVE flag so we skip ACL saves on all other files
*/
jcr->acl_data->flags &= ~BACL_FLAG_SAVE_NATIVE;
goto bail_out;
+#endif
case ENOENT:
goto bail_out;
default:
switch (errno) {
case ENOENT:
return bacl_exit_ok;
- case ENOSYS:
- case ENOTSUP:
- case EOPNOTSUPP:
+#if defined(BACL_ENOTSUP)
+ case BACL_ENOTSUP:
Mmsg1(jcr->errmsg, _("acl_delete_def_file error on file \"%s\": filesystem doesn't support ACLs\n"),
jcr->last_fname);
return bacl_exit_ok;
+#endif
default:
Mmsg2(jcr->errmsg, _("acl_delete_def_file error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
case ENOENT:
acl_free(acl);
return bacl_exit_ok;
- case ENOSYS:
- case ENOTSUP:
- case EOPNOTSUPP:
+#if defined(BACL_ENOTSUP)
+ case BACL_ENOTSUP:
Mmsg1(jcr->errmsg, _("acl_set_file error on file \"%s\": filesystem doesn't support ACLs\n"),
jcr->last_fname);
Dmsg2(100, "acl_set_file error acl=%s file=%s filesystem doesn't support ACLs\n",
jcr->acl_data->content, jcr->last_fname);
acl_free(acl);
return bacl_exit_ok;
+#endif
default:
Mmsg2(jcr->errmsg, _("acl_set_file error on file \"%s\": ERR=%s\n"),
jcr->last_fname, be.bstrerror());
if ((n = getacl(jcr->last_fname, 0, acls)) < 0) {
switch (errno) {
- case ENOSYS:
- case ENOTSUP:
- case EOPNOTSUPP:
+#if defined(BACL_ENOTSUP)
+ case BACL_ENOTSUP:
/**
* Not supported, just pretend there is nothing to see
*
pm_strcpy(jcr->acl_data->content, "");
jcr->acl_data->content_length = 0;
return bacl_exit_ok;
+#endif
case ENOENT:
pm_strcpy(jcr->acl_data->content, "");
jcr->acl_data->content_length = 0;
#define ACL_TYPE_NONE 0x0
#endif
+#if defined(HAVE_FREEBSD_OS) || \
+ defined(HAVE_DARWIN_OS) || \
+ defined(HAVE_HPUX_OS) || \
+ defined(HAVE_LINUX_OS)
+#define BACL_ENOTSUP EOPNOTSUPP
+#elif defined(HAVE_IRIX_OS)
+#define BACL_ENOTSUP ENOSYS
+#endif
+
#define BACL_FLAG_SAVE_NATIVE 0x01
#define BACL_FLAG_SAVE_AFS 0x02
case -1:
switch (errno) {
case ENOENT:
- case ENOTSUP:
- case EOPNOTSUPP:
+ case BXATTR_ENOTSUP:
return bxattr_exit_ok;
default:
Mmsg2(jcr->errmsg, _("llistxattr error on file \"%s\": ERR=%s\n"),
case -1:
switch (errno) {
case ENOENT:
- case ENOTSUP:
- case EOPNOTSUPP:
+ case BXATTR_ENOTSUP:
retval = bxattr_exit_ok;
goto bail_out;
default:
case -1:
switch (errno) {
case ENOENT:
- case ENOTSUP:
- case EOPNOTSUPP:
+ case BXATTR_ENOTSUP:
retval = bxattr_exit_ok;
goto bail_out;
default:
if (xattr_value_len < 0) {
switch (errno) {
case ENOENT:
- case ENOTSUP:
- case EOPNOTSUPP:
+ case BXATTR_ENOTSUP:
retval = bxattr_exit_ok;
goto bail_out;
default:
if (lsetxattr(jcr->last_fname, current_xattr->name, current_xattr->value, current_xattr->value_length, 0) != 0) {
switch (errno) {
case ENOENT:
- case ENOTSUP:
- case EOPNOTSUPP:
+ case BXATTR_ENOTSUP:
goto bail_out;
default:
Mmsg2(jcr->errmsg, _("lsetxattr error on file \"%s\": ERR=%s\n"),
#ifndef __XATTR_H
#define __XATTR_H
+#if defined(HAVE_LINUX_OS)
+#define BXATTR_ENOTSUP EOPNOTSUPP
+#elif defined(HAVE_DARWIN_OS)
+#define BXATTR_ENOTSUP ENOTSUP
+#endif
+
/*
* Magic used in the magic field of the xattr struct.
* This way we can see we encounter a valid xattr struct.