lib: Use a common helper function to compare checksums
So we get a consistent error message; came up in a PR review. Closes: #1277 Approved by: jlebon
This commit is contained in:
1 parent
16c31a9b58
commit
e744f2ad6f
5 files changed
+39
-24
No files matched your search
@@ -1004,6 +1004,22 @@ ostree_checksum_file_async_finish (GFile *f,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Common helper to compare checksums for an object, so we have a consistent
|
||||
* error message.
|
||||
*/
|
||||
gboolean
|
||||
_ostree_compare_object_checksum (OstreeObjectType objtype,
|
||||
const char *expected,
|
||||
const char *actual,
|
||||
GError **error)
|
||||
{
|
||||
if (!g_str_equal (expected, actual))
|
||||
return glnx_throw (error, "Corrupted %s object; checksum expected='%s' actual='%s'",
|
||||
ostree_object_type_to_string (objtype),
|
||||
expected, actual);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ostree_create_directory_metadata:
|
||||
* @dir_info: a #GFileInfo containing directory information
|
||||
|
||||
Reference in new issue
Block a user