forked from Mirrors/flatpak-builder
Update to latest libglnx
parent
0632b550f9
commit
9f72237f3f
2
libglnx
2
libglnx
|
@ -1 +1 @@
|
|||
Subproject commit e226ccf6913d1d852fde1e150a99fab508f85c34
|
||||
Subproject commit 6f1ee5db1400b13a9a0fa0b2274ae34e8710c1aa
|
|
@ -229,7 +229,7 @@ builder_context_class_init (BuilderContextClass *klass)
|
|||
static void
|
||||
builder_context_init (BuilderContext *self)
|
||||
{
|
||||
GLnxLockFile init = GLNX_LOCK_FILE_INIT;
|
||||
GLnxLockFile init = { 0, };
|
||||
g_autofree char *path = NULL;
|
||||
|
||||
self->rofiles_file_lock = init;
|
||||
|
|
|
@ -1008,20 +1008,17 @@ flatpak_allocate_tmpdir (int tmpdir_dfd,
|
|||
while (tmpdir_name == NULL)
|
||||
{
|
||||
g_autofree char *tmpdir_name_template = g_strconcat (tmpdir_prefix, "XXXXXX", NULL);
|
||||
glnx_fd_close int new_tmpdir_fd = -1;
|
||||
g_autoptr(GError) local_error = NULL;
|
||||
g_autofree char *lock_name = NULL;
|
||||
g_auto(GLnxTmpDir) new_tmpdir = { 0, };
|
||||
|
||||
/* No existing tmpdir found, create a new */
|
||||
|
||||
if (!glnx_mkdtempat (dfd_iter.fd, tmpdir_name_template, 0777, error))
|
||||
if (!glnx_mkdtempat (dfd_iter.fd, tmpdir_name_template, 0777,
|
||||
&new_tmpdir, error))
|
||||
return FALSE;
|
||||
|
||||
if (!glnx_opendirat (dfd_iter.fd, tmpdir_name_template, FALSE,
|
||||
&new_tmpdir_fd, error))
|
||||
return FALSE;
|
||||
|
||||
lock_name = g_strconcat (tmpdir_name_template, "-lock", NULL);
|
||||
lock_name = g_strconcat (new_tmpdir.path, "-lock", NULL);
|
||||
|
||||
/* Note, at this point we can race with another process that picks up this
|
||||
* new directory. If that happens we need to retry, making a new directory. */
|
||||
|
@ -1030,6 +1027,7 @@ flatpak_allocate_tmpdir (int tmpdir_dfd,
|
|||
{
|
||||
if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
|
||||
{
|
||||
glnx_tmpdir_unset (&new_tmpdir); /* Don't delete */
|
||||
continue;
|
||||
}
|
||||
else
|
||||
|
@ -1039,8 +1037,9 @@ flatpak_allocate_tmpdir (int tmpdir_dfd,
|
|||
}
|
||||
}
|
||||
|
||||
tmpdir_name = g_steal_pointer (&tmpdir_name_template);
|
||||
tmpdir_fd = glnx_steal_fd (&new_tmpdir_fd);
|
||||
tmpdir_name = g_strdup (new_tmpdir.path);
|
||||
tmpdir_fd = dup (new_tmpdir.fd);
|
||||
glnx_tmpdir_unset (&new_tmpdir); /* Don't delete */
|
||||
}
|
||||
|
||||
if (tmpdir_name_out)
|
||||
|
|
Loading…
Reference in New Issue