diff options
author | Colin Walters <walters@verbum.org> | 2016-05-31 11:53:27 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2016-06-01 15:02:41 +0000 |
commit | c148631a98407647bb989bb73d2b707e309344f9 (patch) | |
tree | b0e28f8093224a06e69c92204e137ae879337a0f /src/libotutil/ot-variant-utils.c | |
parent | f725d39f111bd0d362a583c3a4902e3194fd74d8 (diff) | |
download | ostree-c148631a98407647bb989bb73d2b707e309344f9.tar.gz |
lib: Drop GFile variant mapping API for fd-relative
In addition to generic fd relative porting,
this is a necessary preparatory step for libglnx porting, because
when I tried to use `g_mapped_file_new` I hit an issue with
it using a different error domain from GIO.
Thankfully libglnx consistently uses the GIO error domain, and here
we're now using it for the `open()` call.
Closes: #317
Approved by: jlebon
Diffstat (limited to 'src/libotutil/ot-variant-utils.c')
-rw-r--r-- | src/libotutil/ot-variant-utils.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/libotutil/ot-variant-utils.c b/src/libotutil/ot-variant-utils.c index b9fe94b9..26054459 100644 --- a/src/libotutil/ot-variant-utils.c +++ b/src/libotutil/ot-variant-utils.c @@ -117,46 +117,6 @@ ot_util_variant_take_ref (GVariant *variant) return g_variant_take_ref (variant); } -/** - * ot_util_variant_map: - * @src: a #GFile - * @type: Use this for variant - * @trusted: See documentation of g_variant_new_from_data() - * @out_variant: (out): Return location for new variant - * @error: - * - * Memory-map @src, and store a new #GVariant referring to this memory - * in @out_variant. Note the returned @out_variant is not floating. - */ -gboolean -ot_util_variant_map (GFile *src, - const GVariantType *type, - gboolean trusted, - GVariant **out_variant, - GError **error) -{ - gboolean ret = FALSE; - g_autoptr(GVariant) ret_variant = NULL; - GMappedFile *mfile = NULL; - - mfile = gs_file_map_noatime (src, NULL, error); - if (!mfile) - goto out; - - ret_variant = g_variant_new_from_data (type, - g_mapped_file_get_contents (mfile), - g_mapped_file_get_length (mfile), - trusted, - (GDestroyNotify) g_mapped_file_unref, - mfile); - g_variant_ref_sink (ret_variant); - - ret = TRUE; - ot_transfer_out_value(out_variant, &ret_variant); - out: - return ret; -} - gboolean ot_util_variant_map_at (int dfd, const char *path, |