1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Optionally call fdatasync() instead of fsync() only if _POSIX_SYNCHRONIZED_IO

is positive, which should only be the case on operating systems that
actually support fdatasync(). (CVS 2732)

FossilOrigin-Name: a9b341dccffaf324a64139d6f482599258ef7009
This commit is contained in:
drh
2005-09-22 15:45:04 +00:00
parent de29e3e9be
commit c035e6e4ab
3 changed files with 12 additions and 9 deletions

View File

@@ -828,10 +828,13 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
/* If the FULLSYNC failed, try to do a normal fsync() */
if( rc ) rc = fsync(fd);
#else
#else /* if !defined(F_FULLSYNC) */
#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO>0
if( dataOnly ){
rc = fdatasync(fd);
}else{
}else
#endif /* _POSIX_SYNCHRONIZED_IO > 0 */
{
rc = fsync(fd);
}
#endif /* defined(F_FULLFSYNC) */