mirror of
https://github.com/transmission/transmission
synced 2025-02-03 13:03:50 +00:00
(trunk libT) posix_fadvise() tweak to the new verify code.
This commit is contained in:
parent
f4c0b8c3c2
commit
0746a8eafa
1 changed files with 8 additions and 0 deletions
|
@ -13,6 +13,11 @@
|
|||
#include <unistd.h> /* S_ISREG */
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_POSIX_FADVISE
|
||||
#define _XOPEN_SOURCE 600
|
||||
#include <fcntl.h> /* posix_fadvise() */
|
||||
#endif
|
||||
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include "transmission.h"
|
||||
|
@ -70,6 +75,9 @@ verifyTorrent( tr_torrent * tor, tr_bool * stopFlag )
|
|||
{
|
||||
char * filename = tr_buildPath( tor->downloadDir, file->name, NULL );
|
||||
fp = fopen( filename, "rb" );
|
||||
#ifdef HAVE_POSIX_FADVISE
|
||||
posix_fadvise( fileno( fp ), 0, 0, POSIX_FADV_SEQUENTIAL );
|
||||
#endif
|
||||
/* fprintf( stderr, "opening file #%d (%s) -- %p\n", fileIndex, filename, fp ); */
|
||||
tr_free( filename );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue