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:
@@ -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) */
|
||||
|
||||
Reference in New Issue
Block a user