diff options
author | Colin Walters <walters@verbum.org> | 2012-04-10 16:40:22 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-04-11 22:04:06 -0400 |
commit | f15c1845842bd892add6c4524410f696a152b962 (patch) | |
tree | 03aad7efe32960dc4c9c9f762f1e8417613056fb /src/ostree/ot-builtin-diff.c | |
parent | fa4cbc8b89c63d5c43991c720d2633ec27ea55b2 (diff) | |
download | ostree-f15c1845842bd892add6c4524410f696a152b962.tar.gz |
core: Clean up checksumming
Don't expose GChecksum in APIs. Add a new stream class which allows
us to pass an input stream somewhere, but gather a checksum as it's
read.
Move some bits of the internals towards binary csums.
Diffstat (limited to 'src/ostree/ot-builtin-diff.c')
-rw-r--r-- | src/ostree/ot-builtin-diff.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ostree/ot-builtin-diff.c b/src/ostree/ot-builtin-diff.c index 6d9b50e2..38a22a3f 100644 --- a/src/ostree/ot-builtin-diff.c +++ b/src/ostree/ot-builtin-diff.c @@ -69,7 +69,7 @@ get_file_checksum (GFile *f, { gboolean ret = FALSE; ot_lfree char *ret_checksum = NULL; - GChecksum *tmp_checksum = NULL; + ot_lfree guchar *csum = NULL; if (OSTREE_IS_REPO_FILE (f)) { @@ -78,15 +78,14 @@ get_file_checksum (GFile *f, else { if (!ostree_checksum_file (f, OSTREE_OBJECT_TYPE_RAW_FILE, - &tmp_checksum, cancellable, error)) + &csum, cancellable, error)) goto out; - ret_checksum = g_strdup (g_checksum_get_string (tmp_checksum)); + ret_checksum = ostree_checksum_from_bytes (csum); } ret = TRUE; ot_transfer_out_value(out_checksum, &ret_checksum); out: - ot_clear_checksum (&tmp_checksum); return ret; } |