mirror of
https://github.com/ostreedev/ostree.git
synced 2024-12-23 21:35:26 +03:00
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:
parent
7748c361ef
commit
24cb0ffc6a
2
libglnx
2
libglnx
@ -1 +1 @@
|
|||||||
Subproject commit 3d162e772db80f6664a78583268150d2e1d1d29e
|
Subproject commit afe3c3a86178c29ceaa3a5e46397ab2fa97202b3
|
@ -989,14 +989,13 @@ _ostree_make_temporary_symlink_at (int tmp_dirfd,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
g_autofree char *tmpname = NULL;
|
char *tmpname = g_strdup ("tmplink.XXXXXX");
|
||||||
guint i;
|
guint i;
|
||||||
const int max_attempts = 128;
|
const int max_attempts = 128;
|
||||||
|
|
||||||
for (i = 0; i < max_attempts; i++)
|
for (i = 0; i < max_attempts; i++)
|
||||||
{
|
{
|
||||||
g_free (tmpname);
|
glnx_gen_temp_name (tmpname);
|
||||||
tmpname = gs_fileutil_gen_tmp_name (NULL, NULL);
|
|
||||||
if (symlinkat (target, tmp_dirfd, tmpname) < 0)
|
if (symlinkat (target, tmp_dirfd, tmpname) < 0)
|
||||||
{
|
{
|
||||||
if (errno == EEXIST)
|
if (errno == EEXIST)
|
||||||
|
Loading…
Reference in New Issue
Block a user