muxer: Use fdatasync() instead fsync() to reduce I/O

This commit is contained in:
Jaroslav Kysela 2014-05-14 20:47:38 +02:00
parent de8d533e51
commit 6dc94ef3ce

View file

@ -452,10 +452,10 @@ muxer_cache_update(muxer_t *m, int fd, off_t pos, size_t size)
case MC_CACHE_SYSTEM:
break;
case MC_CACHE_SYNC:
fsync(fd);
fdatasync(fd);
break;
case MC_CACHE_SYNCDONTKEEP:
fsync(fd);
fdatasync(fd);
/* fall through */
case MC_CACHE_DONTKEEP:
posix_fadvise(fd, pos, size, POSIX_FADV_DONTNEED);