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:
parent
7fcf0a294b
commit
091abed323
1 changed files with 4 additions and 0 deletions
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue