Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
e0fc97bf
Commit
e0fc97bf
authored
24 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
DB3 fixes
parent
b5fab0c8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/libldbm/ldbm.c
+20
-12
20 additions, 12 deletions
libraries/libldbm/ldbm.c
servers/slapd/back-ldbm/back-ldbm.h
+5
-3
5 additions, 3 deletions
servers/slapd/back-ldbm/back-ldbm.h
with
25 additions
and
15 deletions
libraries/libldbm/ldbm.c
+
20
−
12
View file @
e0fc97bf
...
...
@@ -58,7 +58,7 @@ ldbm_datum_dup( LDBM ldbm, Datum data )
static
int
ldbm_initialized
=
0
;
#if
def
ined(
HAVE_BERKELEY_DB_THREAD
) || defined( HAVE_BERKELEY_DB_THREAD )
#ifdef HAVE_BERKELEY_DB_THREAD
#define LDBM_LOCK ((void)0)
#define LDBM_UNLOCK ((void)0)
#else
...
...
@@ -100,7 +100,6 @@ ldbm_db_errcall( const char *prefix, char *message )
}
/* a dbEnv for BERKELEYv2 */
static
DB_ENV
ldbm_Env_internal
;
DB_ENV
*
ldbm_Env
=
NULL
;
int
ldbm_initialize
(
void
)
...
...
@@ -110,26 +109,30 @@ int ldbm_initialize( void )
if
(
ldbm_initialized
++
)
return
1
;
memset
(
&
ldbm_Env_internal
,
0
,
sizeof
(
DB_ENV
));
ldbm_Env
=
&
ldbm_Env_internal
;
#if DB_VERSION_MAJOR < 3
ldbm_Env
=
calloc
(
1
,
sizeof
(
DB_ENV
));
if
(
ldbm_Env
==
NULL
)
return
1
;
ldbm_Env
->
db_errcall
=
ldbm_db_errcall
;
ldbm_Env
->
db_errpfx
=
"==>"
;
#else
ldbm_Env
=
NULL
;
#endif
envFlags
=
DB_CREATE
envFlags
=
#if defined( HAVE_BERKELEY_DB_THREAD )
|
DB_THREAD
DB_THREAD
|
#endif
;
DB_CREATE
;
if
(
#if DB_VERSION_MAJOR >= 3
(
err
=
db_env_create
(
&
ldbm_Env
,
0
))
err
=
db_env_create
(
&
ldbm_Env
,
0
);
#elif DB_VERSION_MAJOR >= 2
(
err
=
db_appinit
(
NULL
,
NULL
,
ldbm_Env
,
envFlags
)
)
err
=
db_appinit
(
NULL
,
NULL
,
ldbm_Env
,
envFlags
)
;
#endif
)
{
if
(
err
)
{
char
error
[
BUFSIZ
];
if
(
err
<
0
)
{
...
...
@@ -144,7 +147,11 @@ int ldbm_initialize( void )
#endif
return
(
1
);
}
#if DB_VERSION_MAJOR >= 3
ldbm_Env
->
set_errcall
(
ldbm_Env
,
ldbm_db_errcall
);
ldbm_Env
->
set_errpfx
(
ldbm_Env
,
"==>"
);
envFlags
|=
DB_INIT_MPOOL
;
err
=
ldbm_Env
->
open
(
ldbm_Env
,
NULL
,
NULL
,
envFlags
,
0
);
if
(
err
!=
0
)
...
...
@@ -161,6 +168,7 @@ int ldbm_initialize( void )
"ldbm_initialize(): FATAL error in db_appinit() : %s
\n
"
,
error
);
#endif
ldbm_Env
->
close
(
ldbm_Env
,
0
);
return
(
1
);
}
#endif
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-ldbm/back-ldbm.h
+
5
−
3
View file @
e0fc97bf
...
...
@@ -14,7 +14,7 @@ LDAP_BEGIN_DECL
#define DEFAULT_CACHE_SIZE 1000
#ifdef
HAVE_BERKELEY_DB2
#if
def
ined(
HAVE_BERKELEY_DB
) && DB_VERSION_MAJOR >=
2
# define DEFAULT_DBCACHE_SIZE (100 * DEFAULT_DB_PAGE_SIZE)
#else
# define DEFAULT_DBCACHE_SIZE 100000
...
...
@@ -122,8 +122,10 @@ struct ldbminfo {
DBCache
li_dbcache
[
MAXDBCACHE
];
ldap_pvt_thread_mutex_t
li_dbcache_mutex
;
ldap_pvt_thread_cond_t
li_dbcache_cv
;
#ifdef HAVE_BERKELEY_DB2
DB_ENV
li_db_env
;
#if 0
#if defined(HAVE_BERKELEY_DB) && DB_VERSION_MAJOR >= 2
DB_ENV *li_db_env;
#endif
#endif
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment