mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-21 23:29:34 -05:00
ITS#7682 F_NOCACHE: Allow error, skip any O_DIRECT
We can run without F_NOCACHE if it fails. And we do not know what combining it with O_DIRECT means, if a system has both.
This commit is contained in:
parent
26e226b2a8
commit
cdcf9da600
1 changed files with 3 additions and 8 deletions
|
|
@ -10169,17 +10169,12 @@ mdb_env_copy2(MDB_env *env, const char *path, unsigned int flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env->me_psize >= env->me_os_psize) {
|
if (env->me_psize >= env->me_os_psize) {
|
||||||
#ifdef O_DIRECT
|
#ifdef F_NOCACHE /* __APPLE__ */
|
||||||
|
(void) fcntl(newfd, F_NOCACHE, 1);
|
||||||
|
#elif defined O_DIRECT
|
||||||
/* Set O_DIRECT if the file system supports it */
|
/* Set O_DIRECT if the file system supports it */
|
||||||
if ((rc = fcntl(newfd, F_GETFL)) != -1)
|
if ((rc = fcntl(newfd, F_GETFL)) != -1)
|
||||||
(void) fcntl(newfd, F_SETFL, rc | O_DIRECT);
|
(void) fcntl(newfd, F_SETFL, rc | O_DIRECT);
|
||||||
#endif
|
|
||||||
#ifdef F_NOCACHE /* __APPLE__ */
|
|
||||||
rc = fcntl(newfd, F_NOCACHE, 1);
|
|
||||||
if (rc) {
|
|
||||||
rc = ErrCode();
|
|
||||||
goto leave;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue