xbps_repo_close: only unlock the file lock if repo was opened as such.

If xbps_repo_open() was called with the lock arg set, xbps_repo_close()
will now unlock the repo file lock, without the need to set it.

This avoids the need to always unlock the file lock even if it wasn't
locked previously. This also introduceds an ABI/API break, but this
way it's cleaner.
This commit is contained in:
Juan RP
2015-01-11 09:11:38 +01:00
parent 9aaff4e2d0
commit b23855f692
7 changed files with 18 additions and 16 deletions

View File

@ -98,7 +98,7 @@ xbps_rpool_release(struct xbps_handle *xhp _unused)
while ((repo = SIMPLEQ_FIRST(&rpool_queue))) {
SIMPLEQ_REMOVE(&rpool_queue, repo, xbps_repo, entries);
xbps_repo_close(repo, true);
xbps_repo_close(repo);
free(repo);
}
if (xhp->repositories)