OstreeRepoMode mode = OSTREE_REPO_MODE_BARE_USER;
if (TEMP_FAILURE_RETRY (fgetxattr (mount_root_dfd, "user.test", NULL, 0)) < 0 &&
- errno == ENOTSUP)
+ (errno == ENOTSUP || errno == EOPNOTSUPP))
mode = OSTREE_REPO_MODE_ARCHIVE;
g_debug ("%s: Creating repository in mode %u", G_STRFUNC, mode);
g_autoptr(GBytes) bytes = glnx_fgetxattr_bytes (tmpf.fd, "security.selinux", &local_error);
if (!bytes)
{
- /* libglnx preserves errno */
- if (G_IN_SET (errno, ENOTSUP, ENODATA))
+ /* libglnx preserves errno. The EOPNOTSUPP case can't be part of a
+ * 'case' statement because on most but not all architectures,
+ * it's numerically equal to ENOTSUP. */
+ if (G_IN_SET (errno, ENOTSUP, ENODATA) || errno == EOPNOTSUPP)
{
*can_relabel = FALSE;
return TRUE;
const guint8 *data = g_bytes_get_data (bytes, &data_len);
if (fsetxattr (tmpf.fd, "security.selinux", data, data_len, 0) < 0)
{
- if (errno == ENOTSUP)
+ if (errno == ENOTSUP || errno == EOPNOTSUPP)
{
*can_relabel = FALSE;
return TRUE;
if (fsetxattr (tmpf.fd, "user.test", "novalue", strlen ("novalue"), 0) < 0)
{
- if (errno == ENOTSUP)
+ if (errno == ENOTSUP || errno == EOPNOTSUPP)
{
*has_user_xattrs = FALSE;
return TRUE;