repo: Fix temporary directory allocation

We looked for and locked old temporary directories so we can
reuse them if not in use. However, once we found one that
we can reuse we didn't stop iterating, and eventually we
reached the end. This means we can lock multiple dirs.

Closes: #273
Approved by: giuseppe
This commit is contained in:
Alexander Larsson 2016-04-22 09:29:59 +02:00 committed by Colin Walters (automation)
parent 8609cb036b
commit ad019def9a

View File

@ -5012,7 +5012,7 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd,
if (!glnx_dirfd_iterator_init_at (tmpdir_dfd, ".", FALSE, &dfd_iter, error))
return FALSE;
while (TRUE)
while (tmpdir_name == NULL)
{
gs_dirfd_iterator_cleanup GSDirFdIterator child_dfd_iter = { 0, };
struct dirent *dent;