Changeset 8293


Ignore:
Timestamp:
Apr 26, 2009, 7:59:36 AM (12 years ago)
Author:
charles
Message:

(trunk libT) make tr_loadFile() use tr_open_file_for_scanning()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r8247 r8293  
    3333
    3434#include "transmission.h"
     35#include "fdlimit.h"
    3536#include "ConvertUTF.h"
    3637#include "list.h"
     
    489490
    490491    /* Load the torrent file into our buffer */
    491     file = fopen( path, "rb" );
     492    file = tr_open_file_for_scanning( path );
    492493    if( !file )
    493494    {
     
    502503        const int err = errno;
    503504        tr_err( err_fmt, path, _( "Memory allocation failed" ) );
    504         fclose( file );
     505        tr_close_file( file );
    505506        errno = err;
    506507        return NULL;
     
    510511        const int err = errno;
    511512        tr_err( err_fmt, path, tr_strerror( errno ) );
    512         fclose( file );
     513        tr_close_file( file );
    513514        free( buf );
    514515        errno = err;
     
    516517    }
    517518
    518     fclose( file );
     519    tr_close_file( file );
    519520    *size = sb.st_size;
    520521    return buf;
Note: See TracChangeset for help on using the changeset viewer.