xbps-rindex: switch named semaphore only for the target architecture.

This commit is contained in:
Juan RP
2014-01-31 18:44:24 +01:00
parent 4ee0f854bd
commit 4f7385e4a6
5 changed files with 39 additions and 23 deletions

View File

@@ -116,7 +116,7 @@ int
sign_repo(struct xbps_handle *xhp, const char *repodir,
const char *privkey, const char *signedby)
{
sem_t *sem;
struct idxlock *il;
struct stat st;
struct xbps_repo *repo;
xbps_dictionary_t pkgd, meta = NULL;
@@ -137,7 +137,7 @@ sign_repo(struct xbps_handle *xhp, const char *repodir,
return -1;
}
if ((sem = index_lock()) == NULL)
if ((il = index_lock(xhp)) == NULL)
return EINVAL;
/*
@@ -296,7 +296,7 @@ sign_repo(struct xbps_handle *xhp, const char *repodir,
xbps_dictionary_count(repo->idx) == 1 ? "" : "s");
out:
index_unlock(sem);
index_unlock(il);
if (rsa) {
RSA_free(rsa);