Changeset 8169


Ignore:
Timestamp:
Apr 6, 2009, 11:51:55 PM (13 years ago)
Author:
charles
Message:

(trunk libT) posix_fadvise() tweak to the new verify code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/verify.c

    r8161 r8169  
    1313#include <unistd.h> /* S_ISREG */
    1414#include <sys/stat.h>
     15
     16#ifdef HAVE_POSIX_FADVISE
     17 #define _XOPEN_SOURCE 600
     18 #include <fcntl.h> /* posix_fadvise() */
     19#endif
    1520
    1621#include <openssl/sha.h>
     
    7176            char * filename = tr_buildPath( tor->downloadDir, file->name, NULL );
    7277            fp = fopen( filename, "rb" );
     78#ifdef HAVE_POSIX_FADVISE
     79            posix_fadvise( fileno( fp ), 0, 0, POSIX_FADV_SEQUENTIAL );
     80#endif
    7381            /* fprintf( stderr, "opening file #%d (%s) -- %p\n", fileIndex, filename, fp ); */
    7482            tr_free( filename );
Note: See TracChangeset for help on using the changeset viewer.