mirror of
https://github.com/transmission/transmission
synced 2024-12-25 17:17:31 +00:00
call fcntl(F_NOCACHE,1) right before closing a local datafile. Does it have any effect? Who knows.
This commit is contained in:
parent
8d413e98fc
commit
99318552eb
1 changed files with 5 additions and 0 deletions
|
@ -305,6 +305,11 @@ tr_close_file( int fd )
|
|||
const int err = errno;
|
||||
posix_fadvise( fd, 0, 0, POSIX_FADV_DONTNEED );
|
||||
errno = err;
|
||||
#endif
|
||||
#ifdef SYS_DARWIN
|
||||
/* it's unclear to me from the man pages if this actually flushes out the cache,
|
||||
* but it couldn't hurt... */
|
||||
fcntl( fd, F_NOCACHE, 1 );
|
||||
#endif
|
||||
close( fd );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue