[hacktree] Don't use g_variant_new_from_fixed_array(), it was only added in 2.31
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hacktree] Don't use g_variant_new_from_fixed_array(), it was only added in 2.31
- Date: Thu, 20 Oct 2011 14:21:54 +0000 (UTC)
commit b7d45436a01ef1b7ad99ab56a511ac2a93d31283
Author: Colin Walters <walters verbum org>
Date: Thu Oct 20 10:20:51 2011 -0400
Don't use g_variant_new_from_fixed_array(), it was only added in 2.31
g_variant_new_from_data() works, and actually allows us to avoid
a memdup()/free().
configure.ac | 2 +-
src/libostree/ostree-core.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 43f18cc..f817b19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,7 +30,7 @@ LT_INIT
PKG_PROG_PKG_CONFIG
-PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0])
+PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0 >= 2.30])
AM_PATH_PYTHON
diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c
index fb6ad1b..fa13909 100644
--- a/src/libostree/ostree-core.c
+++ b/src/libostree/ostree-core.c
@@ -96,9 +96,9 @@ read_xattr_name_array (const char *path,
g_variant_builder_add (builder, "(@ay ay)",
g_variant_new_bytestring (p),
- g_variant_new_fixed_array (G_VARIANT_TYPE ("y"), buf, bytes_read, 1));
+ g_variant_new_from_data (G_VARIANT_TYPE ("ay"),
+ buf, bytes_read, FALSE, g_free, buf));
- g_free (buf);
p = p + strlen (p) + 1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]