1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-03 04:53:27 +00:00

(trunk libT) do for tr_close_file() what r8348 did for tr_open_file_for_scanning()

This commit is contained in:
Charles Kerr 2009-05-07 11:54:09 +00:00
parent 7fcf0a294b
commit 091abed323

View file

@ -243,7 +243,11 @@ void
tr_close_file( int fd )
{
#if defined(HAVE_POSIX_FADVISE)
const int err = errno;
/* Set hint about not caching this file.
It's okay for this to fail silently, so don't let it affect errno */
posix_fadvise( fd, 0, 0, POSIX_FADV_DONTNEED );
errno = err;
#endif
close( fd );
}