Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
pkg create only needs a readonly lock
Baptiste Daroussin committed 12 years ago
commit 136ae8ff15141ae34f7e2e04e83ec1c0ce165a5d
parent a11cd23
1 file changed +2 -2
modified src/create.c
@@ -87,9 +87,9 @@ pkg_create_matches(int argc, char **argv, match_t match, pkg_formats fmt,
		return (EX_IOERR);
	}
	/* XXX: get rid of hardcoded timeouts */
-
	if (pkgdb_obtain_lock(db, PKGDB_LOCK_EXCLUSIVE, 0.5, 20) != EPKG_OK) {
+
	if (pkgdb_obtain_lock(db, PKGDB_LOCK_READONLY, 0, 0) != EPKG_OK) {
		pkgdb_close(db);
-
		warnx("Cannot get an exclusive lock on a database, it is locked by another process");
+
		warnx("Cannot get a read lock on a database, it is locked by another process");
		return (EX_TEMPFAIL);
	}