summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-03-06 19:22:01 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-06-11 07:02:18 +0000
commit36d1bfb4ed1fda9abf59a17d84acc1853a003e5d (patch)
tree12f1d2603bd3b30d1a28b0354f4d1087fa05e6bc /src/database.c
parent7aed449427348824f7fbfc0e9dc698ea6519f91e (diff)
downloadapk-tools-36d1bfb4ed1fda9abf59a17d84acc1853a003e5d.tar.gz
apk-tools-36d1bfb4ed1fda9abf59a17d84acc1853a003e5d.tar.bz2
apk-tools-36d1bfb4ed1fda9abf59a17d84acc1853a003e5d.tar.xz
apk-tools-36d1bfb4ed1fda9abf59a17d84acc1853a003e5d.zip
db: make apk_wait a part of dbopts
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/database.c b/src/database.c
index 3d49c9e..e7d6b4e 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1025,8 +1025,7 @@ static void handle_alarm(int sig)
{
}
-int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts,
- int apk_wait)
+int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
{
const char *msg = NULL;
struct apk_repository_list *repo = NULL;
@@ -1086,7 +1085,7 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts,
if (db->lock_fd < 0 ||
flock(db->lock_fd, LOCK_EX | LOCK_NB) < 0) {
msg = "Unable to lock database";
- if (apk_wait) {
+ if (dbopts->lock_wait) {
struct sigaction sa, old_sa;
apk_message("Waiting for repository lock");
@@ -1095,7 +1094,7 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts,
sa.sa_flags = SA_ONESHOT;
sigaction(SIGALRM, &sa, &old_sa);
- alarm(apk_wait);
+ alarm(dbopts->lock_wait);
if (flock(db->lock_fd, LOCK_EX) < 0)
goto ret_errno;