Changeset 11863


Ignore:
Timestamp:
Feb 9, 2011, 5:34:23 AM (12 years ago)
Author:
jordan
Message:

(trunk libT) silence compiler warning in libtransmission/fdlimit.c: "ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r11817 r11863  
    398398     */
    399399    if( alreadyExisted && ( file_size < (uint64_t)sb.st_size ) )
    400         ftruncate( o->fd, file_size );
     400    {
     401        if( ftruncate( o->fd, file_size ) == -1 )
     402        {
     403            const int err = errno;
     404            tr_err( _( "Couldn't truncate \"%1$s\": %2$s" ), filename, tr_strerror( err ) );
     405            return err;
     406        }
     407    }
    401408
    402409    if( writable && !alreadyExisted && ( allocation == TR_PREALLOCATE_SPARSE ) )
Note: See TracChangeset for help on using the changeset viewer.