lib/repo: Use correct name for tmpdir lockfile
authorColin Walters <walters@verbum.org>
Thu, 21 Sep 2017 18:50:54 +0000 (14:50 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 21 Sep 2017 21:10:34 +0000 (21:10 +0000)
Such an evil bug ðŸ™ˆ. I was just reading an strace trying to figure out what was
going on, and noticed we had the `XXXXXX` in the lockfile name. It was only
after that I realized that that this might *be* the cause of the skopeo issue.

This is another case where we definitely need more test coverage of things that
actually use the API multiple times in process; might look at dusting off the
work for the rpm-ostree test.

Closes: https://github.com/ostreedev/ostree/issues/1196
Closes: #1204
Approved by: jlebon

src/libostree/ostree-repo.c

index 5c3c298753f1f3046ccf44283b669d6f59b6c63b..b1d88e489ffec6f9e34f5ad6cb97cfbb56fe8295 100644 (file)
@@ -4990,7 +4990,7 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd,
 
       /* 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. */
-      if (!_ostree_repo_try_lock_tmpdir (tmpdir_dfd, tmpdir_name_template,
+      if (!_ostree_repo_try_lock_tmpdir (new_tmpdir.src_dfd, new_tmpdir.path,
                                          file_lock_out, &did_lock,
                                          error))
         return FALSE;