OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Michael Schloh
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   14-Oct-2002 20:02:23
  Branch: HEAD                             Handle: 2002101419022200

  Modified files:
    openpkg-src/postfix     postfix-db4.patch

  Log:
    Remove an uneccessary transaction context, reducing changes to a minimum.

  Summary:
    Revision    Changes     Path
    1.2         +4  -29     openpkg-src/postfix/postfix-db4.patch
  ____________________________________________________________________________

  Index: openpkg-src/postfix/postfix-db4.patch
  ============================================================
  $ cvs diff -u -r1.1 -r1.2 postfix-db4.patch
  --- openpkg-src/postfix/postfix-db4.patch     14 Oct 2002 17:57:13 -0000      1.1
  +++ openpkg-src/postfix/postfix-db4.patch     14 Oct 2002 18:02:22 -0000      1.2
  @@ -1,42 +1,17 @@
   diff -Naur postfix-1.1.11.orig/src/util/dict_db.c postfix-1.1.11/src/util/dict_db.c
   --- postfix-1.1.11.orig/src/util/dict_db.c   Mon Oct 14 18:54:26 2002
  -+++ postfix-1.1.11/src/util/dict_db.c        Mon Oct 14 19:14:12 2002
  -@@ -429,6 +429,10 @@
  -     struct stat st;
  -     DB     *db;
  -     char   *db_path;
  -+#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
  -+    DB_TXN *db_txnp = NULL;
  -+    static DB_ENV *db_env = NULL;
  -+#endif
  -     int     lock_fd = -1;
  -     int     dbfd;
  - 
  -@@ -512,7 +516,7 @@
  -     db_flags |= DB_CREATE;
  -     if (open_flags & O_TRUNC)
  -     db_flags |= DB_TRUNCATE;
  --    if ((errno = db_create(&db, 0, 0)) != 0)
  -+    if ((errno = db_create(&db, db_env, 0)) != 0)
  -     msg_fatal("create DB database: %m");
  -     if (db == 0)
  -     msg_panic("db_create null result");
  -@@ -520,10 +524,18 @@
  ++++ postfix-1.1.11/src/util/dict_db.c        Mon Oct 14 19:52:16 2002
  +@@ -520,8 +520,13 @@
        msg_fatal("set DB cache size %d: %m", DICT_DB_CACHE_SIZE);
        if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0)
        msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM);
  -+
   +#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
  -+    if ((errno = db_env->txn_begin(db_env, NULL, &db_txnp, 0)) != 0)
  -+    msg_fatal("begin transaction failed: %m");
  -+    if ((errno = db->open(db, db_txnp, db_path, 0, type, db_flags, 0644)) != 0)
  ++    if ((errno = db->open(db, 0, db_path, 0, type, db_flags, 0644)) != 0)
   +    msg_fatal("open database %s: %m", db_path);
   +#else
        if ((errno = db->open(db, db_path, 0, type, db_flags, 0644)) != 0)
        msg_fatal("open database %s: %m", db_path);
  ++#endif
        if ((errno = db->fd(db, &dbfd)) != 0)
        msg_fatal("get database file descriptor: %m");
  -+#endif
    #endif
  -     if (dict_flags & DICT_FLAG_LOCK) {
  -     if (myflock(lock_fd, INTERNAL_LOCK, MYFLOCK_OP_NONE) < 0)
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to