copy-acl: ignore ENOTSUP on HP-UX
[gnulib.git] / lib / acl-internal.h
index 676e57a..7f9cde1 100644 (file)
 # define fchmod(fd, mode) (-1)
 #endif
 
+/* Recognize some common errors such as from an NFS mount that does
+   not support ACLs, even when local drives do.  */
+#if defined __APPLE__ && defined __MACH__ /* MacOS X */
+# define ACL_NOT_WELL_SUPPORTED(Err) \
+     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY || (Err) == ENOENT)
+#elif defined EOPNOTSUPP /* Tru64 NFS */
+# define ACL_NOT_WELL_SUPPORTED(Err) \
+     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY || (Err) == EOPNOTSUPP)
+#else
+# define ACL_NOT_WELL_SUPPORTED(Err) \
+     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY)
+#endif
 
 #if USE_ACL
 
@@ -125,17 +137,6 @@ rpl_acl_set_fd (int fd, acl_t acl)
 #   define MODE_INSIDE_ACL 1
 #  endif
 
-#  if defined __APPLE__ && defined __MACH__ /* MacOS X */
-#   define ACL_NOT_WELL_SUPPORTED(Err) \
-     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY || (Err) == ENOENT)
-#  elif defined EOPNOTSUPP /* Tru64 NFS */
-#   define ACL_NOT_WELL_SUPPORTED(Err) \
-     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY || (Err) == EOPNOTSUPP)
-#  else
-#   define ACL_NOT_WELL_SUPPORTED(Err) \
-     ((Err) == ENOTSUP || (Err) == ENOSYS || (Err) == EINVAL || (Err) == EBUSY)
-#  endif
-
 /* Return the number of entries in ACL.
    Return -1 and set errno upon failure to determine it.  */
 /* Define a replacement for acl_entries if needed. (Only Linux has it.)  */