gio: fix set_selinux_context coding style

Mostly for cosmetic and readability, follow more closely the glib-style.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2020-12-01 13:20:11 +04:00
parent f9cc77da73
commit 3f18b77fb3

View File

@ -2714,7 +2714,13 @@ set_selinux_context (char *filename,
return FALSE; return FALSE;
} }
if (is_selinux_enabled ()) { if (!is_selinux_enabled ())
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
_("SELinux is not enabled on this system"));
return FALSE;
}
if (setfilecon_raw (filename, val) < 0) if (setfilecon_raw (filename, val) < 0)
{ {
int errsv = errno; int errsv = errno;
@ -2725,11 +2731,6 @@ set_selinux_context (char *filename,
g_strerror (errsv)); g_strerror (errsv));
return FALSE; return FALSE;
} }
} else {
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
_("SELinux is not enabled on this system"));
return FALSE;
}
return TRUE; return TRUE;
} }