Use (xxx->open)() to work-around glibc's open() behaving having changed.
authorRalf Corsépius <corsepiu@fedoraproject.org>
Wed, 22 Aug 2007 13:17:23 +0000 (15:17 +0200)
committerRalf Corsépius <corsepiu@fedoraproject.org>
Wed, 22 Aug 2007 13:17:23 +0000 (15:17 +0200)
rpmdb/db3.c
rpmdb/tdbi.c
rpmdb/tjfn.c

index 2efcbcf..4ca257a 100644 (file)
@@ -430,9 +430,9 @@ static int db_init(dbiIndex dbi, const char * dbhome,
   }
 
 #if (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR != 0) || (DB_VERSION_MAJOR == 4)
-    rc = dbenv->open(dbenv, dbhome, eflags, dbi->dbi_perms);
+    rc = (dbenv->open)(dbenv, dbhome, eflags, dbi->dbi_perms);
 #else
-    rc = dbenv->open(dbenv, dbhome, NULL, eflags, dbi->dbi_perms);
+    rc = (dbenv->open)(dbenv, dbhome, NULL, eflags, dbi->dbi_perms);
 #endif
     rc = cvtdberr(dbi, "dbenv->open", rc, _debug);
     if (rc)
@@ -867,7 +867,7 @@ static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags)
            if (rc) goto exit;
        }
            
-       rc = dbenv->open(dbenv, dbhome,
+       rc = (dbenv->open)(dbenv, dbhome,
             DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_USE_ENVIRON, 0);
        rc = cvtdberr(dbi, "dbenv->open", rc, _debug);
        if (rc) goto exit;
@@ -1303,10 +1303,10 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
 #endif
 
 #if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
-               rc = db->open(db, txnid, dbpath, dbsubfile,
+               rc = (db->open)(db, txnid, dbpath, dbsubfile,
                    dbi->dbi_type, oflags, dbi->dbi_perms);
 #else
-               rc = db->open(db, dbpath, dbsubfile,
+               rc = (db->open)(db, dbpath, dbsubfile,
                    dbi->dbi_type, oflags, dbi->dbi_perms);
 #endif
 
index cafc326..66ad5a4 100644 (file)
@@ -26,9 +26,9 @@ main(int argc, char *argv[])
     }
 
 #if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
-    rc = db->open(db, txnid, dbfile, NULL, DB_UNKNOWN, DB_RDONLY, 0664);
+    rc = (db->open)(db, txnid, dbfile, NULL, DB_UNKNOWN, DB_RDONLY, 0664);
 #else
-    rc = db->open(db, dbfile, NULL, DB_UNKNOWN, DB_RDONLY, 0664);
+    rc = (db->open)(db, dbfile, NULL, DB_UNKNOWN, DB_RDONLY, 0664);
 #endif
     if (rc != 0) {
        db->err(db, rc, "db->open");
index 2569bb5..e42e790 100644 (file)
@@ -42,7 +42,7 @@ db_init(const char * home, DB_ENV ** dbenvp)
     dbenv->set_errpfx(dbenv, "tjfn");
 
     flags = DB_CREATE | DB_INIT_MPOOL;
-    if ((ret = dbenv->open(dbenv, home, flags, 0)) != 0)
+    if ((ret = (dbenv->open)(dbenv, home, flags, 0)) != 0)
        goto exit;
 
 exit:
@@ -71,12 +71,12 @@ db_open(const char * dbfn, DB_ENV * dbenv, DB ** dbp)
     }
 
 #if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
-    ret = db->open(db, NULL, dbfn, NULL, DB_BTREE, DB_CREATE, 0664);
+    ret = (db->open)(db, NULL, dbfn, NULL, DB_BTREE, DB_CREATE, 0664);
 #else
-    ret = db->open(db, dbfn, NULL, DB_BTREE, DB_CREATE, 0664);
+    ret = (db->open)(db, dbfn, NULL, DB_BTREE, DB_CREATE, 0664);
 #endif
     if (ret != 0) {
-       db->err(db, ret, "db->open(%s)", dbfn);
+       db->err(db, ret, "(db->open)(%s)", dbfn);
        goto err;
     }