Bump libglnx, port a few callers to new error API

Testing out the waters here. I think we should roll this into any future code
cleanup reworking we do.

Closes: #747
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-03-22 16:04:58 +00:00
1 parent 94c47cde6a
commit 4cf210b128
3 files changed
+7 -24

No files matched your search

+1 -1
Submodule libglnx updated: 5309e363aa...602fdd93cb.
+3 -11
View File
@@ -1798,13 +1798,9 @@ ostree_validate_structureof_objtype (guchar objtype,
GError **error) GError **error)
{ {
OstreeObjectType objtype_v = (OstreeObjectType) objtype; OstreeObjectType objtype_v = (OstreeObjectType) objtype;
if (objtype_v < OSTREE_OBJECT_TYPE_FILE if (objtype_v < OSTREE_OBJECT_TYPE_FILE
|| objtype_v > OSTREE_OBJECT_TYPE_COMMIT) || objtype_v > OSTREE_OBJECT_TYPE_COMMIT)
{ return glnx_throw (error, "Invalid object type '%u'", objtype);
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Invalid object type '%u'", objtype);
return FALSE;
}
return TRUE; return TRUE;
} }
@@ -1837,11 +1833,7 @@ ostree_validate_structureof_checksum_string (const char *checksum,
size_t len = strlen (checksum); size_t len = strlen (checksum);
if (len != OSTREE_SHA256_STRING_LEN) if (len != OSTREE_SHA256_STRING_LEN)
{ return glnx_throw (error, "Invalid rev '%s'", checksum);
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Invalid rev '%s'", checksum);
return FALSE;
}
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
+3 -12
View File
@@ -1831,10 +1831,7 @@ ostree_repo_create (OstreeRepo *self,
if (mkdir (repopath, 0755) != 0) if (mkdir (repopath, 0755) != 0)
{ {
if (G_UNLIKELY (errno != EEXIST)) if (G_UNLIKELY (errno != EEXIST))
{ return glnx_throw_errno (error);
glnx_set_error_from_errno (error);
return FALSE;
}
} }
if (!glnx_opendirat (AT_FDCWD, repopath, TRUE, &dfd, error)) if (!glnx_opendirat (AT_FDCWD, repopath, TRUE, &dfd, error))
@@ -1858,10 +1855,7 @@ ostree_repo_create (OstreeRepo *self,
return FALSE; return FALSE;
} }
else else
{ return glnx_throw_errno (error);
glnx_set_error_from_errno (error);
return FALSE;
}
} }
for (guint i = 0; i < G_N_ELEMENTS (state_dirs); i++) for (guint i = 0; i < G_N_ELEMENTS (state_dirs); i++)
@@ -1870,10 +1864,7 @@ ostree_repo_create (OstreeRepo *self,
if (mkdirat (dfd, elt, 0755) == -1) if (mkdirat (dfd, elt, 0755) == -1)
{ {
if (G_UNLIKELY (errno != EEXIST)) if (G_UNLIKELY (errno != EEXIST))
{ return glnx_throw_errno (error);
glnx_set_error_from_errno (error);
return FALSE;
}
} }
} }