core: Port to new libglnx tempname API
Drops another libgsystem use, and as bonus we malloc less too. Closes: #311 Approved by: jlebon
This commit is contained in:
1 parent
7748c361ef
commit
24cb0ffc6a
2 files changed
+3
-4
No files matched your search
+1
-1
Submodule libglnx updated: 3d162e772d...afe3c3a861.
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user