From 24cb0ffc6a3711179b34f95a54c12e839b88d43b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 29 May 2016 13:06:36 -0400 Subject: [PATCH] core: Port to new libglnx tempname API Drops another libgsystem use, and as bonus we malloc less too. Closes: #311 Approved by: jlebon --- libglnx | 2 +- src/libostree/ostree-core.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libglnx b/libglnx index 3d162e77..afe3c3a8 160000 --- a/libglnx +++ b/libglnx @@ -1 +1 @@ -Subproject commit 3d162e772db80f6664a78583268150d2e1d1d29e +Subproject commit afe3c3a86178c29ceaa3a5e46397ab2fa97202b3 diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c index d393c496..135d15d4 100644 --- a/src/libostree/ostree-core.c +++ b/src/libostree/ostree-core.c @@ -989,14 +989,13 @@ _ostree_make_temporary_symlink_at (int tmp_dirfd, GError **error) { gboolean ret = FALSE; - g_autofree char *tmpname = NULL; + char *tmpname = g_strdup ("tmplink.XXXXXX"); guint i; const int max_attempts = 128; for (i = 0; i < max_attempts; i++) { - g_free (tmpname); - tmpname = gs_fileutil_gen_tmp_name (NULL, NULL); + glnx_gen_temp_name (tmpname); if (symlinkat (target, tmp_dirfd, tmpname) < 0) { if (errno == EEXIST)