Ignore:
Timestamp:
Jun 21, 2009, 7:53:51 AM (12 years ago)
Author:
charles
Message:

(trunk libT) #2228: transmission should learn to truncate files on updating torrents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r8725 r8726  
    343343    }
    344344
     345    /* If the file already exists and it's too large, truncate it.
     346     * This is a fringe case that happens if a torrent's been updated
     347     * and one of the updated torrent's files is smaller.
     348     * http://trac.transmissionbt.com/ticket/2228
     349     * https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/318249
     350     */
     351    if( alreadyExisted && ( desiredFileSize < (uint64_t)sb.st_size ) )
     352        ftruncate( file->fd, desiredFileSize );
     353
    345354    if( doWrite && !alreadyExisted && ( preallocationMode == TR_PREALLOCATE_SPARSE ) )
    346355        preallocateFileSparse( file->fd, desiredFileSize );
Note: See TracChangeset for help on using the changeset viewer.