diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c index 957de429d..793afa858 100644 --- a/libtransmission/fdlimit.c +++ b/libtransmission/fdlimit.c @@ -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 ); }