teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.9.0-beta1-rofs-rpmdb.patch

Panu Matilainen 7528e0
commit f1f7b59dab0c09402790daa04441fac435f52e26
Panu Matilainen 7528e0
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 7528e0
Date:   Fri Jan 21 09:32:58 2011 +0200
Panu Matilainen 7528e0
Panu Matilainen 7528e0
    Permit queries from rpmdb on read-only media (RhBug:671200)
Panu Matilainen 7528e0
    (cherry picked from commit a429c99e13fbe9926243f29b78df8d64222c4469)
Panu Matilainen 7528e0
Panu Matilainen 7528e0
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
Panu Matilainen 7528e0
index 45b5363..365cd13 100644
Panu Matilainen 7528e0
--- a/lib/backend/db3.c
Panu Matilainen 7528e0
+++ b/lib/backend/db3.c
Panu Matilainen 7528e0
@@ -171,7 +171,7 @@ static int db_init(rpmdb rdb, const char * dbhome)
Panu Matilainen 7528e0
 	free(fstr);
Panu Matilainen 7528e0
 
Panu Matilainen 7528e0
 	rc = (dbenv->open)(dbenv, dbhome, eflags, rdb->db_perms);
Panu Matilainen 7528e0
-	if (rc == EACCES) {
Panu Matilainen 7528e0
+	if (rc == EACCES || rc == EROFS) {
Panu Matilainen 7528e0
 	    eflags |= DB_PRIVATE;
Panu Matilainen 7528e0
 	    retry_open--;
Panu Matilainen 7528e0
 	} else {