From a470550d57cfd3a2bffe936bb941957f2e705147 Mon Sep 17 00:00:00 2001 From: Ken Murchison Date: Wed, 15 Aug 2007 17:20:55 +0000 Subject: [PATCH] fix dereferenced calls to open() and close() --- cyrus/imap/annotate.c | 6 +++--- cyrus/imap/arbitron.c | 10 +++++----- cyrus/imap/cvt_cyrusdb.c | 10 +++++----- cyrus/imap/cyr_dbtool.c | 6 +++--- cyrus/imap/duplicate.c | 6 +++--- cyrus/imap/fetchnews.c | 6 +++--- cyrus/imap/mboxkey.c | 18 +++++++++--------- cyrus/imap/mboxlist.c | 10 +++++----- cyrus/imap/quota_db.c | 6 +++--- cyrus/imap/seen_bigdb.c | 6 +++--- cyrus/imap/seen_db.c | 18 +++++++++--------- cyrus/imap/tls.c | 10 +++++----- cyrus/lib/auth_pts.c | 6 +++--- cyrus/lib/cyrusdb_berkeley.c | 18 +++++++++--------- cyrus/lib/test/cyrusdb.c | 6 +++--- cyrus/lib/test/rnddb.c | 4 ++-- cyrus/ptclient/ptdump.c | 6 +++--- cyrus/ptclient/ptexpire.c | 6 +++--- cyrus/ptclient/ptloader.c | 8 ++++---- 19 files changed, 83 insertions(+), 83 deletions(-) diff --git a/cyrus/imap/annotate.c b/cyrus/imap/annotate.c index d35b832ce6..30cb28448e 100644 --- a/cyrus/imap/annotate.c +++ b/cyrus/imap/annotate.c @@ -40,7 +40,7 @@ * */ /* - * $Id: annotate.c,v 1.35 2007/02/05 18:41:45 jeaton Exp $ + * $Id: annotate.c,v 1.36 2007/08/15 17:20:55 murch Exp $ */ #include @@ -253,7 +253,7 @@ void annotatemore_open(char *fname) strcat(fname, FNAME_ANNOTATIONS); } - ret = DB->open(fname, CYRUSDB_CREATE, &anndb); + ret = (DB->open)(fname, CYRUSDB_CREATE, &anndb); if (ret != 0) { syslog(LOG_ERR, "DBERROR: opening %s: %s", fname, cyrusdb_strerror(ret)); @@ -270,7 +270,7 @@ void annotatemore_close(void) int r; if (annotate_dbopen) { - r = DB->close(anndb); + r = (DB->close)(anndb); if (r) { syslog(LOG_ERR, "DBERROR: error closing annotations: %s", cyrusdb_strerror(r)); diff --git a/cyrus/imap/arbitron.c b/cyrus/imap/arbitron.c index 99dc018756..1040ee0656 100644 --- a/cyrus/imap/arbitron.c +++ b/cyrus/imap/arbitron.c @@ -39,7 +39,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: arbitron.c,v 1.43 2007/03/30 18:40:20 murch Exp $ */ +/* $Id: arbitron.c,v 1.44 2007/08/15 17:20:55 murch Exp $ */ #include @@ -419,14 +419,14 @@ void process_seen(const char *path, const char *user) int r; struct db *tmp = NULL; - r = DB->open(path, 0, &tmp); + r = (DB->open)(path, 0, &tmp); if(r) goto done; DB->foreach(tmp, "", 0, process_user_p, process_user_cb, (void *) user, NULL); done: - if(tmp) DB->close(tmp); + if(tmp) (DB->close)(tmp); } static int process_subs_cb(void *rockp __attribute__((unused)), @@ -475,14 +475,14 @@ void process_subs(const char *path, const char *user) int r; struct db *tmp = NULL; - r = SUBDB->open(path, 0, &tmp); + r = (SUBDB->open)(path, 0, &tmp); if(r) goto done; SUBDB->foreach(tmp, "", 0, process_subs_p, process_subs_cb, (void *) user, NULL); done: - if(tmp) SUBDB->close(tmp); + if(tmp) (SUBDB->close)(tmp); } void report_users(struct user_list *u) diff --git a/cyrus/imap/cvt_cyrusdb.c b/cyrus/imap/cvt_cyrusdb.c index c836ba5fe6..384f34f5ee 100644 --- a/cyrus/imap/cvt_cyrusdb.c +++ b/cyrus/imap/cvt_cyrusdb.c @@ -40,7 +40,7 @@ * */ /* - * $Id: cvt_cyrusdb.c,v 1.16 2006/11/30 17:11:17 murch Exp $ + * $Id: cvt_cyrusdb.c,v 1.17 2007/08/15 17:20:55 murch Exp $ */ #include @@ -157,10 +157,10 @@ int main(int argc, char *argv[]) printf("Converting from %s (%s) to %s (%s)\n", old_db, DB_OLD->name, new_db, DB_NEW->name); - r = DB_OLD->open(old_db, 0, &odb); + r = (DB_OLD->open)(old_db, 0, &odb); if(r != CYRUSDB_OK) fatal("can't open old database", EC_TEMPFAIL); - r = DB_NEW->open(new_db, CYRUSDB_CREATE, &ndb); + r = (DB_NEW->open)(new_db, CYRUSDB_CREATE, &ndb); if(r != CYRUSDB_OK) fatal("can't open new database", EC_TEMPFAIL); @@ -173,8 +173,8 @@ int main(int argc, char *argv[]) fprintf(stderr, "Warning: apparently empty database converted.\n"); - DB_OLD->close(odb); - DB_NEW->close(ndb); + (DB_OLD->close)(odb); + (DB_NEW->close)(ndb); cyrus_done(); diff --git a/cyrus/imap/cyr_dbtool.c b/cyrus/imap/cyr_dbtool.c index 92d7b7dbd3..862e3522ce 100644 --- a/cyrus/imap/cyr_dbtool.c +++ b/cyrus/imap/cyr_dbtool.c @@ -40,7 +40,7 @@ * */ /* - * $Id: cyr_dbtool.c,v 1.1 2007/01/09 17:41:35 murch Exp $ + * $Id: cyr_dbtool.c,v 1.2 2007/08/15 17:20:55 murch Exp $ */ #include @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) cyrus_init(alt_config, "cyr_dbtool", 0); - r = DB_OLD->open(old_db, db_flags, &odb); + r = (DB_OLD->open)(old_db, db_flags, &odb); if(r != CYRUSDB_OK) fatal("can't open database", EC_TEMPFAIL); @@ -250,7 +250,7 @@ int main(int argc, char *argv[]) printf("Unknown action %s\n", action); } - DB_OLD->close(odb); + (DB_OLD->close)(odb); cyrus_done(); diff --git a/cyrus/imap/duplicate.c b/cyrus/imap/duplicate.c index 6b6b55b844..a370604a64 100644 --- a/cyrus/imap/duplicate.c +++ b/cyrus/imap/duplicate.c @@ -39,7 +39,7 @@ * */ -/* $Id: duplicate.c,v 1.43 2007/02/14 13:29:02 murch Exp $ */ +/* $Id: duplicate.c,v 1.44 2007/08/15 17:20:55 murch Exp $ */ #include @@ -105,7 +105,7 @@ int duplicate_init(char *fname, int myflags __attribute__((unused))) strcat(fname, FNAME_DELIVERDB); } - r = DB->open(fname, CYRUSDB_CREATE, &dupdb); + r = (DB->open)(fname, CYRUSDB_CREATE, &dupdb); if (r != 0) syslog(LOG_ERR, "DBERROR: opening %s: %s", fname, cyrusdb_strerror(r)); @@ -395,7 +395,7 @@ int duplicate_done(void) int r = 0; if (duplicate_dbopen) { - r = DB->close(dupdb); + r = (DB->close)(dupdb); if (r) { syslog(LOG_ERR, "DBERROR: error closing deliverdb: %s", cyrusdb_strerror(r)); diff --git a/cyrus/imap/fetchnews.c b/cyrus/imap/fetchnews.c index f648f7b0e0..6e92a3c9b4 100644 --- a/cyrus/imap/fetchnews.c +++ b/cyrus/imap/fetchnews.c @@ -38,7 +38,7 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: fetchnews.c,v 1.17 2007/03/30 18:40:20 murch Exp $ + * $Id: fetchnews.c,v 1.18 2007/08/15 17:20:55 murch Exp $ */ #include @@ -94,7 +94,7 @@ int newsrc_init(char *fname, int myflags __attribute__((unused))) strcat(fname, FNAME_NEWSRCDB); } - r = DB->open(fname, CYRUSDB_CREATE, &newsrc_db); + r = (DB->open)(fname, CYRUSDB_CREATE, &newsrc_db); if (r != 0) syslog(LOG_ERR, "DBERROR: opening %s: %s", fname, cyrusdb_strerror(r)); @@ -112,7 +112,7 @@ int newsrc_done(void) int r = 0; if (newsrc_dbopen) { - r = DB->close(newsrc_db); + r = (DB->close)(newsrc_db); if (r) { syslog(LOG_ERR, "DBERROR: error closing fetchnews.db: %s", cyrusdb_strerror(r)); diff --git a/cyrus/imap/mboxkey.c b/cyrus/imap/mboxkey.c index 5d23d4ca88..d2abb78a8c 100644 --- a/cyrus/imap/mboxkey.c +++ b/cyrus/imap/mboxkey.c @@ -1,5 +1,5 @@ /* mboxkey.c -- implementation of URLAUTH mailbox keys - * $Id: mboxkey.c,v 1.3 2007/03/27 19:53:09 murch Exp $ + * $Id: mboxkey.c,v 1.4 2007/08/15 17:20:55 murch Exp $ * * Copyright (c) 1998-2005 Carnegie Mellon University. All rights reserved. * @@ -150,7 +150,7 @@ int mboxkey_open(const char *user, /* otherwise, close the existing database */ if (mboxkeydb) { abortcurrent(mboxkeydb); - r = DB->close(mboxkeydb->db); + r = (DB->close)(mboxkeydb->db); if (r) { syslog(LOG_ERR, "DBERROR: error closing mboxkeydb: %s", cyrusdb_strerror(r)); @@ -164,7 +164,7 @@ int mboxkey_open(const char *user, /* open the mboxkeydb corresponding to user */ fname = mboxkey_getpath(user); - r = DB->open(fname, (flags & MBOXKEY_CREATE) ? CYRUSDB_CREATE : 0, + r = (DB->open)(fname, (flags & MBOXKEY_CREATE) ? CYRUSDB_CREATE : 0, &mboxkeydb->db); if (r != 0) { int level = (flags & MBOXKEY_CREATE) ? LOG_ERR : LOG_DEBUG; @@ -325,7 +325,7 @@ int mboxkey_close(struct mboxkey *mboxkeydb) /* free the old database hanging around */ abortcurrent(lastmboxkey); - r = DB->close(lastmboxkey->db); + r = (DB->close)(lastmboxkey->db); if (r != CYRUSDB_OK) { syslog(LOG_ERR, "DBERROR: error closing lastmboxkey: %s", cyrusdb_strerror(r)); @@ -409,7 +409,7 @@ int mboxkey_done(void) if (lastmboxkey) { abortcurrent(lastmboxkey); - r = DB->close(lastmboxkey->db); + r = (DB->close)(lastmboxkey->db); if (r) { syslog(LOG_ERR, "DBERROR: error closing lastmboxkey: %s", cyrusdb_strerror(r)); @@ -482,10 +482,10 @@ int mboxkey_merge(const char *tmpfile, const char *tgtfile) struct mboxkey_merge_rock rock; /* xxx does this need to be CYRUSDB_CREATE? */ - r = DB->open(tmpfile, CYRUSDB_CREATE, &tmp); + r = (DB->open)(tmpfile, CYRUSDB_CREATE, &tmp); if(r) goto done; - r = DB->open(tgtfile, CYRUSDB_CREATE, &tgt); + r = (DB->open)(tgtfile, CYRUSDB_CREATE, &tgt); if(r) goto done; rock.db = tgt; @@ -498,8 +498,8 @@ int mboxkey_merge(const char *tmpfile, const char *tgtfile) done: - if(tgt) DB->close(tgt); - if(tmp) DB->close(tmp); + if(tgt) (DB->close)(tgt); + if(tmp) (DB->close)(tmp); return r; } diff --git a/cyrus/imap/mboxlist.c b/cyrus/imap/mboxlist.c index 03e7643293..444392ce70 100644 --- a/cyrus/imap/mboxlist.c +++ b/cyrus/imap/mboxlist.c @@ -40,7 +40,7 @@ * */ /* - * $Id: mboxlist.c,v 1.247 2007/03/27 19:53:09 murch Exp $ + * $Id: mboxlist.c,v 1.248 2007/08/15 17:20:55 murch Exp $ */ #include @@ -2722,7 +2722,7 @@ void mboxlist_open(char *fname) flags |= CYRUSDB_MBOXSORT; } - ret = DB->open(fname, flags, &mbdb); + ret = (DB->open)(fname, flags, &mbdb); if (ret != 0) { syslog(LOG_ERR, "DBERROR: opening %s: %s", fname, cyrusdb_strerror(ret)); @@ -2741,7 +2741,7 @@ void mboxlist_close(void) int r; if (mboxlist_dbopen) { - r = DB->close(mbdb); + r = (DB->close)(mbdb); if (r) { syslog(LOG_ERR, "DBERROR: error closing mailboxes: %s", cyrusdb_strerror(r)); @@ -2801,7 +2801,7 @@ mboxlist_opensubs(const char *userid, flags |= CYRUSDB_MBOXSORT; } - r = SUBDB->open(subsfname, flags, ret); + r = (SUBDB->open)(subsfname, flags, ret); if (r != CYRUSDB_OK) { r = IMAP_IOERROR; } @@ -2815,7 +2815,7 @@ mboxlist_opensubs(const char *userid, */ static void mboxlist_closesubs(struct db *sub) { - SUBDB->close(sub); + (SUBDB->close)(sub); } /* diff --git a/cyrus/imap/quota_db.c b/cyrus/imap/quota_db.c index d44411ca0f..22f7a54f32 100644 --- a/cyrus/imap/quota_db.c +++ b/cyrus/imap/quota_db.c @@ -38,7 +38,7 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: quota_db.c,v 1.6 2007/07/10 19:20:30 murch Exp $ + * $Id: quota_db.c,v 1.7 2007/08/15 17:20:57 murch Exp $ * */ @@ -251,7 +251,7 @@ void quotadb_open(char *fname) strlcat(fname, FNAME_QUOTADB, fname_len); } - ret = QDB->open(fname, CYRUSDB_CREATE, &qdb); + ret = (QDB->open)(fname, CYRUSDB_CREATE, &qdb); if (ret != 0) { syslog(LOG_ERR, "DBERROR: opening %s: %s", fname, cyrusdb_strerror(ret)); @@ -270,7 +270,7 @@ void quotadb_close(void) int r; if (quota_dbopen) { - r = QDB->close(qdb); + r = (QDB->close)(qdb); if (r) { syslog(LOG_ERR, "DBERROR: error closing quotas: %s", cyrusdb_strerror(r)); diff --git a/cyrus/imap/seen_bigdb.c b/cyrus/imap/seen_bigdb.c index eba2af8d28..7d5d1217e2 100644 --- a/cyrus/imap/seen_bigdb.c +++ b/cyrus/imap/seen_bigdb.c @@ -1,5 +1,5 @@ /* seen_bigdb.c -- implementation of seen database using one big cyrusdb - * $Id: seen_bigdb.c,v 1.11 2006/11/30 17:11:20 murch Exp $ + * $Id: seen_bigdb.c,v 1.12 2007/08/15 17:20:57 murch Exp $ * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -104,7 +104,7 @@ static void seen_init(void) strcpy(fname, config_dir); strcat(fname, FNAME_SEENDB); - r = DB->open(fname, CYRUSDB_CREATE, &bigdb); + r = (DB->open)(fname, CYRUSDB_CREATE, &bigdb); if (r != 0) { syslog(LOG_ERR, "DBERROR: opening %s: %s", fname, cyrusdb_strerror(r)); @@ -385,7 +385,7 @@ int seen_done(void) int r; if (seen_inited) { - r = DB->close(bigdb); + r = (DB->close)(bigdb); if (r != 0) { syslog(LOG_ERR, "DBERROR: closing seen database: %s", cyrusdb_strerror(r)); diff --git a/cyrus/imap/seen_db.c b/cyrus/imap/seen_db.c index 39df813562..b9d537ebd8 100644 --- a/cyrus/imap/seen_db.c +++ b/cyrus/imap/seen_db.c @@ -1,5 +1,5 @@ /* seen_db.c -- implementation of seen database using per-user berkeley db - * $Id: seen_db.c,v 1.52 2007/03/27 19:53:09 murch Exp $ + * $Id: seen_db.c,v 1.53 2007/08/15 17:20:57 murch Exp $ * * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved. * @@ -157,7 +157,7 @@ int seen_open(struct mailbox *mailbox, /* otherwise, close the existing database */ if (seendb) { abortcurrent(seendb); - r = DB->close(seendb->db); + r = (DB->close)(seendb->db); if (r) { syslog(LOG_ERR, "DBERROR: error closing seendb: %s", cyrusdb_strerror(r)); @@ -170,7 +170,7 @@ int seen_open(struct mailbox *mailbox, /* open the seendb corresponding to user */ fname = seen_getpath(user); - r = DB->open(fname, (flags & SEEN_CREATE) ? CYRUSDB_CREATE : 0, + r = (DB->open)(fname, (flags & SEEN_CREATE) ? CYRUSDB_CREATE : 0, &seendb->db); if (r != 0) { int level = (flags & SEEN_CREATE) ? LOG_ERR : LOG_DEBUG; @@ -416,7 +416,7 @@ int seen_close(struct seen *seendb) /* free the old database hanging around */ abortcurrent(lastseen); - r = DB->close(lastseen->db); + r = (DB->close)(lastseen->db); if (r != CYRUSDB_OK) { syslog(LOG_ERR, "DBERROR: error closing lastseen: %s", cyrusdb_strerror(r)); @@ -555,7 +555,7 @@ int seen_done(void) if (lastseen) { abortcurrent(lastseen); - r = DB->close(lastseen->db); + r = (DB->close)(lastseen->db); if (r) { syslog(LOG_ERR, "DBERROR: error closing lastseen: %s", cyrusdb_strerror(r)); @@ -653,10 +653,10 @@ int seen_merge(const char *tmpfile, const char *tgtfile) struct seen_merge_rock rock; /* xxx does this need to be CYRUSDB_CREATE? */ - r = DB->open(tmpfile, CYRUSDB_CREATE, &tmp); + r = (DB->open)(tmpfile, CYRUSDB_CREATE, &tmp); if(r) goto done; - r = DB->open(tgtfile, CYRUSDB_CREATE, &tgt); + r = (DB->open)(tgtfile, CYRUSDB_CREATE, &tgt); if(r) goto done; rock.db = tgt; @@ -669,8 +669,8 @@ int seen_merge(const char *tmpfile, const char *tgtfile) done: - if(tgt) DB->close(tgt); - if(tmp) DB->close(tmp); + if(tgt) (DB->close)(tgt); + if(tmp) (DB->close)(tmp); return r; } diff --git a/cyrus/imap/tls.c b/cyrus/imap/tls.c index 8bd5049bbf..2179c6d95d 100644 --- a/cyrus/imap/tls.c +++ b/cyrus/imap/tls.c @@ -93,7 +93,7 @@ * */ -/* $Id: tls.c,v 1.53 2007/02/05 18:49:56 jeaton Exp $ */ +/* $Id: tls.c,v 1.54 2007/08/15 17:20:57 murch Exp $ */ #include @@ -650,7 +650,7 @@ int tls_init_serverengine(const char *ident, strlcpy(dbdir, config_dir, sizeof(dbdir)); strlcat(dbdir, FNAME_TLSSESSIONS, sizeof(dbdir)); - r = DB->open(dbdir, CYRUSDB_CREATE, &sessdb); + r = (DB->open)(dbdir, CYRUSDB_CREATE, &sessdb); if (r != 0) { syslog(LOG_ERR, "DBERROR: opening %s: %s", dbdir, cyrusdb_strerror(ret)); @@ -931,7 +931,7 @@ int tls_shutdown_serverengine(void) int r; if (tls_serverengine && sess_dbopen) { - r = DB->close(sessdb); + r = (DB->close)(sessdb); if (r) { syslog(LOG_ERR, "DBERROR: error closing tlsdb: %s", cyrusdb_strerror(r)); @@ -1008,7 +1008,7 @@ int tls_prune_sessions(void) strlcpy(dbdir, config_dir, sizeof(dbdir)); strlcat(dbdir, FNAME_TLSSESSIONS, sizeof(dbdir)); - ret = DB->open(dbdir, CYRUSDB_CREATE, &sessdb); + ret = (DB->open)(dbdir, CYRUSDB_CREATE, &sessdb); if (ret != CYRUSDB_OK) { syslog(LOG_ERR, "DBERROR: opening %s: %s", dbdir, cyrusdb_strerror(ret)); @@ -1019,7 +1019,7 @@ int tls_prune_sessions(void) sess_dbopen = 1; prock.count = prock.deletions = 0; DB->foreach(sessdb, "", 0, &prune_p, &prune_cb, &prock, NULL); - DB->close(sessdb); + (DB->close)(sessdb); sessdb = NULL; sess_dbopen = 0; diff --git a/cyrus/lib/auth_pts.c b/cyrus/lib/auth_pts.c index 40d05e5e1f..36c53bbde1 100644 --- a/cyrus/lib/auth_pts.c +++ b/cyrus/lib/auth_pts.c @@ -1,5 +1,5 @@ /* auth_pts.c -- PTLOADER authorization - * $Id: auth_pts.c,v 1.12 2007/02/05 18:43:26 jeaton Exp $ + * $Id: auth_pts.c,v 1.13 2007/08/15 17:20:57 murch Exp $ * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -359,7 +359,7 @@ static int ptload(const char *identifier, struct auth_state **state) strcpy(fnamebuf, config_dir); strcat(fnamebuf, PTS_DBFIL); - r = the_ptscache_db->open(fnamebuf, CYRUSDB_CREATE, &ptdb); + r = (the_ptscache_db->open)(fnamebuf, CYRUSDB_CREATE, &ptdb); if (r != 0) { syslog(LOG_ERR, "DBERROR: opening %s: %s", fnamebuf, cyrusdb_strerror(ret)); @@ -501,7 +501,7 @@ static int ptload(const char *identifier, struct auth_state **state) } /* close and unlock the database */ - the_ptscache_db->close(ptdb); + (the_ptscache_db->close)(ptdb); return rc; } diff --git a/cyrus/lib/cyrusdb_berkeley.c b/cyrus/lib/cyrusdb_berkeley.c index 33dc9298e7..8c665cadca 100644 --- a/cyrus/lib/cyrusdb_berkeley.c +++ b/cyrus/lib/cyrusdb_berkeley.c @@ -39,7 +39,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cyrusdb_berkeley.c,v 1.18 2007/03/23 13:35:54 murch Exp $ */ +/* $Id: cyrusdb_berkeley.c,v 1.19 2007/08/15 17:20:57 murch Exp $ */ #include @@ -212,7 +212,7 @@ static int init(const char *dbdir, int myflags) r = dbenv->set_cachesize(dbenv, 0, opt * 1024, 0); if (r) { dbenv->err(dbenv, r, "set_cachesize"); - dbenv->close(dbenv, 0); + (dbenv->close)(dbenv, 0); syslog(LOG_ERR, "DBERROR: set_cachesize(): %s", db_strerror(r)); return CYRUSDB_IOERROR; } @@ -223,9 +223,9 @@ static int init(const char *dbdir, int myflags) flags |= DB_INIT_LOCK | DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_TXN; #if (DB_VERSION_MAJOR > 3) || ((DB_VERSION_MAJOR == 3) && (DB_VERSION_MINOR > 0)) - r = dbenv->open(dbenv, dbdir, flags, 0644); + r = (dbenv->open)(dbenv, dbdir, flags, 0644); #else - r = dbenv->open(dbenv, dbdir, NULL, flags, 0644); + r = (dbenv->open)(dbenv, dbdir, NULL, flags, 0644); #endif if (r) { if (do_retry && (r == ENOENT)) { @@ -264,7 +264,7 @@ static int done(void) if (--dbinit) return 0; - r = dbenv->close(dbenv, 0); + r = (dbenv->close)(dbenv, 0); dbinit = 0; if (r) { syslog(LOG_ERR, "DBERROR: error exiting application: %s", @@ -412,15 +412,15 @@ static int myopen(const char *fname, DBTYPE type, int flags, struct db **ret) if (flags & CYRUSDB_MBOXSORT) db->set_bt_compare(db, mbox_compar); #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1 - r = db->open(db, NULL, fname, NULL, type, dbflags | DB_AUTO_COMMIT, 0664); + r = (db->open)(db, NULL, fname, NULL, type, dbflags | DB_AUTO_COMMIT, 0664); #else - r = db->open(db, fname, NULL, type, dbflags, 0664); + r = (db->open)(db, fname, NULL, type, dbflags, 0664); #endif if (r != 0) { int level = (flags & CYRUSDB_CREATE) ? LOG_ERR : LOG_DEBUG; syslog(level, "DBERROR: opening %s: %s", fname, db_strerror(r)); - r = db->close(db, DB_NOSYNC); + r = (db->close)(db, DB_NOSYNC); if (r != 0) { syslog(level, "DBERROR: closing %s: %s", fname, db_strerror(r)); } @@ -450,7 +450,7 @@ static int myclose(struct db *db) assert(dbinit && db); /* since we're using txns, we can supply DB_NOSYNC */ - r = a->close(a, DB_NOSYNC); + r = (a->close)(a, DB_NOSYNC); if (r != 0) { syslog(LOG_ERR, "DBERROR: error closing: %s", db_strerror(r)); r = CYRUSDB_IOERROR; diff --git a/cyrus/lib/test/cyrusdb.c b/cyrus/lib/test/cyrusdb.c index 2dc5eba86b..c37d5ce5b1 100644 --- a/cyrus/lib/test/cyrusdb.c +++ b/cyrus/lib/test/cyrusdb.c @@ -70,15 +70,15 @@ int main(int argc, char *argv[]) char *fname = buf + 5; if (db) { /* close it */ - TRY(DB->close(db)); + TRY((DB->close)(db)); } - TRY(DB->open(fname, 1, &db)); + TRY((DB->open)(fname, 1, &db)); printf("ok\n"); } else if (!db) { TRY(db == NULL); } else if (!strncasecmp(buf, "close", 5)) { - TRY(DB->close(db)); + TRY((DB->close)(db)); db = NULL; printf("ok\n"); } else if (!strncasecmp(buf, "put ", 4)) { diff --git a/cyrus/lib/test/rnddb.c b/cyrus/lib/test/rnddb.c index 8ebad989e9..426f27bfae 100644 --- a/cyrus/lib/test/rnddb.c +++ b/cyrus/lib/test/rnddb.c @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) srand(atoi(argv[2])); } - TRY(DB->open("scratch", &db)); + TRY((DB->open)("scratch", &db)); if (DB->consistent) { TRY(DB->consistent(db)); @@ -291,7 +291,7 @@ int main(int argc, char *argv[]) #endif } - TRY(DB->close(db)); + TRY((DB->close)(db)); TRY(DB->done()); do_report(); diff --git a/cyrus/ptclient/ptdump.c b/cyrus/ptclient/ptdump.c index 50f1b338f8..e309738b93 100644 --- a/cyrus/ptclient/ptdump.c +++ b/cyrus/ptclient/ptdump.c @@ -48,7 +48,7 @@ #include "global.h" #include "libconfig.h" -static char rcsid[] = "$Id: ptdump.c,v 1.13 2006/11/30 17:11:24 murch Exp $"; +static char rcsid[] = "$Id: ptdump.c,v 1.14 2007/08/15 17:20:57 murch Exp $"; int config_need_data = 0; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) /* open database */ strcpy(fnamebuf, config_dir); strcat(fnamebuf, PTS_DBFIL); - r = config_ptscache_db->open(fnamebuf, CYRUSDB_CREATE, &ptdb); + r = (config_ptscache_db->open)(fnamebuf, CYRUSDB_CREATE, &ptdb); if(r != CYRUSDB_OK) { fprintf(stderr,"error opening %s (%s)", fnamebuf, cyrusdb_strerror(r)); @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) /* iterate through db, wiping expired entries */ config_ptscache_db->foreach(ptdb, "", 0, NULL, dump_cb, ptdb, NULL); - config_ptscache_db->close(ptdb); + (config_ptscache_db->close)(ptdb); cyrus_done(); diff --git a/cyrus/ptclient/ptexpire.c b/cyrus/ptclient/ptexpire.c index 7680c130df..e4787d6353 100644 --- a/cyrus/ptclient/ptexpire.c +++ b/cyrus/ptclient/ptexpire.c @@ -69,7 +69,7 @@ #include "lock.h" #include "xmalloc.h" -static char rcsid[] = "$Id: ptexpire.c,v 1.20 2007/03/30 18:40:21 murch Exp $"; +static char rcsid[] = "$Id: ptexpire.c,v 1.21 2007/08/15 17:20:57 murch Exp $"; /* global */ time_t timenow; @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) /* open database */ strcpy(fnamebuf, config_dir); strcat(fnamebuf, PTS_DBFIL); - r = config_ptscache_db->open(fnamebuf, CYRUSDB_CREATE, &ptdb); + r = (config_ptscache_db->open)(fnamebuf, CYRUSDB_CREATE, &ptdb); if(r != CYRUSDB_OK) { syslog(LOG_ERR, "error opening %s (%s)", fnamebuf, cyrusdb_strerror(r)); @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) /* iterate through db, wiping expired entries */ config_ptscache_db->foreach(ptdb, "", 0, expire_p, expire_cb, ptdb, NULL); - config_ptscache_db->close(ptdb); + (config_ptscache_db->close)(ptdb); cyrus_done(); diff --git a/cyrus/ptclient/ptloader.c b/cyrus/ptclient/ptloader.c index a2447c5489..bbbf58d086 100644 --- a/cyrus/ptclient/ptloader.c +++ b/cyrus/ptclient/ptloader.c @@ -67,7 +67,7 @@ #include "ptloader.h" static char rcsid[] __attribute__((unused)) = - "$Id: ptloader.c,v 1.45 2007/03/13 17:07:04 jeaton Exp $"; + "$Id: ptloader.c,v 1.46 2007/08/15 17:20:57 murch Exp $"; struct pts_module *pts_modules[] = { #ifdef HAVE_LDAP @@ -148,7 +148,7 @@ int service_init(int argc, char *argv[], char **envp __attribute__((unused))) /* set signal handlers */ signal(SIGPIPE, SIG_IGN); - syslog(LOG_NOTICE, "starting: $Id: ptloader.c,v 1.45 2007/03/13 17:07:04 jeaton Exp $"); + syslog(LOG_NOTICE, "starting: $Id: ptloader.c,v 1.46 2007/08/15 17:20:57 murch Exp $"); while ((opt = getopt(argc, argv, "d:")) != EOF) { switch (opt) { @@ -167,7 +167,7 @@ int service_init(int argc, char *argv[], char **envp __attribute__((unused))) strcpy(fnamebuf, config_dir); strcat(fnamebuf, PTS_DBFIL); - r = DB->open(fnamebuf, CYRUSDB_CREATE, &ptsdb); + r = (DB->open)(fnamebuf, CYRUSDB_CREATE, &ptsdb); if (r != 0) { syslog(LOG_ERR, "DBERROR: opening %s: %s", fnamebuf, cyrusdb_strerror(ret)); @@ -184,7 +184,7 @@ void service_abort(int error) { int r; - r = DB->close(ptsdb); + r = (DB->close)(ptsdb); if (r) { syslog(LOG_ERR, "DBERROR: error closing ptsdb: %s", cyrusdb_strerror(r));