Ignore:
Timestamp:
Oct 19, 2010, 1:56:58 PM (11 years ago)
Author:
charles
Message:

(trunk libT) #3622 "verification ignores return value of pread" -- commit fixVerify.patch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/verify.c

    r11304 r11339  
    101101        if( fd >= 0 ) {
    102102            const ssize_t numRead = tr_pread( fd, buffer, bytesThisPass, filePos );
    103             if( numRead == (ssize_t)bytesThisPass )
    104                 SHA1_Update( &sha, buffer, numRead );
     103            if( numRead > 0 ) {
     104                bytesThisPass = (uint32_t)numRead;
     105                SHA1_Update( &sha, buffer, bytesThisPass );
    105106#if defined HAVE_POSIX_FADVISE && defined POSIX_FADV_DONTNEED
    106             if( numRead > 0 )
    107107                posix_fadvise( fd, filePos, bytesThisPass, POSIX_FADV_DONTNEED );
    108108#endif
     109            }
    109110        }
    110111
Note: See TracChangeset for help on using the changeset viewer.