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
Lukas However
OpenLDAP
Commits
0b9f42d1
Commit
0b9f42d1
authored
Jan 09, 2015
by
Howard Chu
Browse files
ITS#8021 env_sync is invalid in RDONLY env
parent
4500d49f
Changes
2
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/lmdb.h
View file @
0b9f42d1
...
...
@@ -698,7 +698,8 @@ int mdb_env_info(MDB_env *env, MDB_envinfo *stat);
* Data is always written to disk when #mdb_txn_commit() is called,
* but the operating system may keep it buffered. LMDB always flushes
* the OS buffers upon commit as well, unless the environment was
* opened with #MDB_NOSYNC or in part #MDB_NOMETASYNC.
* opened with #MDB_NOSYNC or in part #MDB_NOMETASYNC. This call is
* not valid if the environment was opened with #MDB_RDONLY.
* @param[in] env An environment handle returned by #mdb_env_create()
* @param[in] force If non-zero, force a synchronous flush. Otherwise
* if the environment has the #MDB_NOSYNC flag set the flushes
...
...
@@ -706,6 +707,7 @@ int mdb_env_info(MDB_env *env, MDB_envinfo *stat);
* @return A non-zero error value on failure and 0 on success. Some possible
* errors are:
* <ul>
* <li>EACCES - the environment is read-only.
* <li>EINVAL - an invalid parameter was specified.
* <li>EIO - an error occurred during synchronization.
* </ul>
...
...
libraries/liblmdb/mdb.c
View file @
0b9f42d1
...
...
@@ -2305,6 +2305,8 @@ int
mdb_env_sync
(
MDB_env
*
env
,
int
force
)
{
int
rc
=
0
;
if
(
env
->
me_flags
&
MDB_RDONLY
)
return
EACCES
;
if
(
force
||
!
F_ISSET
(
env
->
me_flags
,
MDB_NOSYNC
))
{
if
(
env
->
me_flags
&
MDB_WRITEMAP
)
{
int
flags
=
((
env
->
me_flags
&
MDB_MAPASYNC
)
&&
!
force
)
...
...
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