]> git.sur5r.net Git - openldap/commitdiff
ITS#3607 use shared memory when configured
authorHoward Chu <hyc@openldap.org>
Fri, 22 Apr 2005 21:18:59 +0000 (21:18 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 22 Apr 2005 21:18:59 +0000 (21:18 +0000)
servers/slapd/back-bdb/init.c

index 755d4194362b587f2e4524246eb59605ca0fc601..1b867440ef4b96000d606280ee0b5e1c84c51d54 100644 (file)
@@ -110,6 +110,12 @@ bdb_do_recovery( BackendDB *be )
        flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL |
                DB_INIT_TXN | DB_USE_ENVIRON | DB_RECOVER;
 
+       /* If a key was set, use shared memory for the BDB environment */
+       if ( bdb->bi_shm_key ) {
+               re_dbenv->set_shm_key( re_dbenv, bdb->bi_shm_key );
+               flags |= DB_SYSTEM_MEM;
+       }
+
        /* Open the environment, which will also perform the recovery */
 #ifdef HAVE_EBCDIC
        strcpy( path, bdb->bi_dbenv_home );