Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
1e29d51b
Commit
1e29d51b
authored
Mar 14, 2003
by
Kurt Zeilenga
Browse files
Update BDB_SUBDIRS code
(which really should be removed as being redundant to DB_CONFIG)
parent
de3a5e13
Changes
2
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-bdb/back-bdb.h
View file @
1e29d51b
...
...
@@ -31,9 +31,9 @@ LDAP_BEGIN_DECL
#define BDB_MAX_ADD_LOOP 30
#ifdef BDB_SUBDIRS
#define BDB_TMP_SUBDIR
LDAP_DIRSEP
"tmp"
#define BDB_LG_SUBDIR
LDAP_DIRSEP
"log"
#define BDB_DATA_SUBDIR
LDAP_DIRSEP
"data"
#define BDB_TMP_SUBDIR "tmp"
#define BDB_LG_SUBDIR "log"
#define BDB_DATA_SUBDIR "data"
#endif
#define BDB_SUFFIX ".bdb"
...
...
servers/slapd/back-bdb/init.c
View file @
1e29d51b
...
...
@@ -208,12 +208,27 @@ bdb_db_open( BackendDB *be )
#ifdef BDB_SUBDIRS
{
char
dir
[
MAXPATHLEN
];
size_t
len
=
strlen
(
bdb
->
bi_dbenv_home
);
strcpy
(
dir
,
bdb
->
bi_dbenv_home
);
strcat
(
&
dir
[
len
],
BDB_TMP_SUBDIR
);
char
dir
[
MAXPATHLEN
],
*
ptr
;
if
(
bdb
->
bi_dbenv_home
[
0
]
==
'.'
)
{
/* If home is a relative path, relative subdirs
* are just concat'd by BDB. We don't want the
* path to be concat'd twice, e.g.
* ./test-db/./test-db/tmp
*/
ptr
=
dir
;
}
else
{
ptr
=
lutil_strcopy
(
dir
,
bdb
->
bi_dbenv_home
);
*
ptr
++
=
LDAP_DIRSEP
[
0
];
#ifdef HAVE_EBCDIC
__atoe
(
dir
);
#endif
}
strcpy
(
ptr
,
BDB_TMP_SUBDIR
);
#ifdef HAVE_EBCDIC
__atoe
(
ptr
);
#endif
rc
=
bdb
->
bi_dbenv
->
set_tmp_dir
(
bdb
->
bi_dbenv
,
dir
);
if
(
rc
!=
0
)
{
#ifdef NEW_LOGGING
...
...
@@ -228,8 +243,10 @@ bdb_db_open( BackendDB *be )
return
rc
;
}
strcat
(
&
dir
[
len
],
BDB_LG_SUBDIR
);
strcpy
(
ptr
,
BDB_LG_SUBDIR
);
#ifdef HAVE_EBCDIC
__atoe
(
ptr
);
#endif
rc
=
bdb
->
bi_dbenv
->
set_lg_dir
(
bdb
->
bi_dbenv
,
dir
);
if
(
rc
!=
0
)
{
#ifdef NEW_LOGGING
...
...
@@ -244,8 +261,10 @@ bdb_db_open( BackendDB *be )
return
rc
;
}
strcat
(
&
dir
[
len
],
BDB_DATA_SUBDIR
);
strcpy
(
ptr
,
BDB_DATA_SUBDIR
);
#ifdef HAVE_EBCDIC
__atoe
(
ptr
);
#endif
rc
=
bdb
->
bi_dbenv
->
set_data_dir
(
bdb
->
bi_dbenv
,
dir
);
if
(
rc
!=
0
)
{
#ifdef NEW_LOGGING
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment