Ignore:
Timestamp:
Apr 28, 2011, 6:40:46 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) tr_torrentGetFileMTime(): if the file being looked at is aleady open in fdlimit's file cache, use that cached handle instead of deriving our own.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r12296 r12397  
    23732373{
    23742374    time_t mtime = 0;
    2375     tr_torrentFindFile2( tor, i, NULL, NULL, &mtime );
     2375    if( !tr_fdFileGetCachedMTime( tor->session, tor->uniqueId, i, &mtime ) )
     2376        tr_torrentFindFile2( tor, i, NULL, NULL, &mtime );
    23762377    return mtime;
    23772378}
     
    29532954***/
    29542955
     2956#ifdef SYS_DARWIN
     2957 #define TR_STAT_MTIME(sb) ((sb).st_mtimespec.tv_sec)
     2958#else
     2959 #define TR_STAT_MTIME(sb) ((sb).st_mtime)
     2960#endif
     2961
     2962
    29552963static bool
    29562964fileExists( const char * filename, time_t * mtime )
     
    29602968
    29612969    if( ok && ( mtime != NULL ) )
    2962     {
    2963 #ifdef SYS_DARWIN
    2964         *mtime = sb.st_mtimespec.tv_sec;
    2965 #else
    2966         *mtime = sb.st_mtime;
    2967 #endif
    2968     }
     2970        *mtime = TR_STAT_MTIME( sb );
    29692971
    29702972    return ok;
Note: See TracChangeset for help on using the changeset viewer.