libglnx porting: Use glnx_set_error_from_errno

⚠️ There is a notable spiked pit trap here around
`posix_fallocate()` and `errno`.  This has bit other projects,
see e.g.
https://github.com/systemd/systemd/commit/7bb87460e691d30c1a7fd23a1a8240776957e05f

Otherwise the port was straightforward.
This commit is contained in:
Colin Walters committed 2016-03-23 10:26:01 -04:00
1 parent 614483ecd1
commit d456fe5adb
13 files changed
+88 -87

No files matched your search

+4 -5
View File
@@ -347,10 +347,9 @@ ostree_sepolicy_get_label (OstreeSePolicy *self,
res = selabel_lookup_raw (self->selinux_hnd, &con, relpath, unix_mode);
if (res != 0)
{
int errsv = errno;
if (errsv != ENOENT)
if (errno != ENOENT)
{
gs_set_error_from_errno (error, errsv);
glnx_set_error_from_errno (error);
goto out;
}
}
@@ -443,7 +442,7 @@ ostree_sepolicy_restorecon (OstreeSePolicy *self,
int res = lsetfilecon (gs_file_get_path_cached (target), label);
if (res != 0)
{
gs_set_error_from_errno (error, errno);
glnx_set_error_from_errno (error);
goto out;
}
}
@@ -491,7 +490,7 @@ ostree_sepolicy_setfscreatecon (OstreeSePolicy *self,
if (setfscreatecon_raw (label) != 0)
{
gs_set_error_from_errno (error, errno);
glnx_set_error_from_errno (error);
return FALSE;
}