mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
(trunk libT) silence compiler warning in libtransmission/fdlimit.c: "ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result"
This commit is contained in:
parent
adf5a2e273
commit
3f9886c3dd
1 changed files with 8 additions and 1 deletions
|
@ -397,7 +397,14 @@ cached_file_open( struct tr_cached_file * o,
|
|||
* https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/318249
|
||||
*/
|
||||
if( alreadyExisted && ( file_size < (uint64_t)sb.st_size ) )
|
||||
ftruncate( o->fd, file_size );
|
||||
{
|
||||
if( ftruncate( o->fd, file_size ) == -1 )
|
||||
{
|
||||
const int err = errno;
|
||||
tr_err( _( "Couldn't truncate \"%1$s\": %2$s" ), filename, tr_strerror( err ) );
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
if( writable && !alreadyExisted && ( allocation == TR_PREALLOCATE_SPARSE ) )
|
||||
preallocate_file_sparse( o->fd, file_size );
|
||||
|
|
Loading…
Reference in a new issue