From 13a0a0556cee22777ca6f8a2b756903a342ba586 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 26 Apr 2009 07:59:36 +0000 Subject: [PATCH] (trunk libT) make tr_loadFile() use tr_open_file_for_scanning() --- libtransmission/utils.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libtransmission/utils.c b/libtransmission/utils.c index 6111dacae..1271c8afc 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -32,6 +32,7 @@ #endif #include "transmission.h" +#include "fdlimit.h" #include "ConvertUTF.h" #include "list.h" #include "utils.h" @@ -488,7 +489,7 @@ tr_loadFile( const char * path, } /* Load the torrent file into our buffer */ - file = fopen( path, "rb" ); + file = tr_open_file_for_scanning( path ); if( !file ) { const int err = errno; @@ -501,7 +502,7 @@ tr_loadFile( const char * path, { const int err = errno; tr_err( err_fmt, path, _( "Memory allocation failed" ) ); - fclose( file ); + tr_close_file( file ); errno = err; return NULL; } @@ -509,13 +510,13 @@ tr_loadFile( const char * path, { const int err = errno; tr_err( err_fmt, path, tr_strerror( errno ) ); - fclose( file ); + tr_close_file( file ); free( buf ); errno = err; return NULL; } - fclose( file ); + tr_close_file( file ); *size = sb.st_size; return buf; }