pkgtools

morpheus pkg tools
git clone git://git.2f30.org/pkgtools
Log | Files | Refs | README | LICENSE

commit 34f8145faf12efe0fba44baaff48eab677d47105
parent 795fb36056da220ed2680e19dbb1a4571d4436b3
Author: sin <sin@2f30.org>
Date:   Fri, 20 Jun 2014 18:02:07 +0100

Remove locking

We have one db-entry per package, so if we decide to lock we should
do it per package.

Diffstat:
Mdb.c | 14--------------
1 file changed, 0 insertions(+), 14 deletions(-)

diff --git a/db.c b/db.c @@ -3,8 +3,6 @@ #include <archive.h> #include <archive_entry.h> #include <dirent.h> -#include <errno.h> -#include <fcntl.h> #include <ftw.h> #include <limits.h> #include <regex.h> @@ -59,14 +57,6 @@ db_new(const char *prefix) return NULL; } - if (flock(dirfd(db->pkgdir), LOCK_EX | LOCK_NB) < 0) { - if (errno == EWOULDBLOCK) - weprintf("package db already locked\n"); - else - weprintf("flock %s:", db->path); - free(db); - return NULL; - } db->rejrules = rej_load(db->prefix); memset(&sa, 0, sizeof(sa)); @@ -91,10 +81,6 @@ db_free(struct db *db) pkg_free(pkg); pkg = tmp; } - if (flock(dirfd(db->pkgdir), LOCK_UN) < 0) { - weprintf("flock %s:", db->path); - return -1; - } closedir(db->pkgdir); rej_free(db->rejrules); free(db);