From ffe9e52e14a0205ffe194ee36b474c8747b6eb0c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 9 Dec 2007 15:26:27 +0000 Subject: [PATCH] I think this one-line change may fix all the "Transmission 0.95 ate my data, corrupted my hard drive, and killed my cat!" complaints --- libtransmission/fdlimit.c | 2 +- libtransmission/utils.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c index 5084b5dc6..a3271ec3d 100644 --- a/libtransmission/fdlimit.c +++ b/libtransmission/fdlimit.c @@ -254,7 +254,7 @@ tr_fdFileCheckout( const char * filename, int write ) } if( winner >= 0 ) { - if( fileIsOpen( &gFd->open[i] ) ) { + if( fileIsOpen( &gFd->open[winner] ) ) { dbgmsg( "closing file '%s', slot #%d", gFd->open[winner].filename, winner ); TrCloseFile( winner ); } diff --git a/libtransmission/utils.c b/libtransmission/utils.c index 494f727be..b5698ce05 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -228,6 +228,9 @@ tr_msg( const char * file, int line, int level, const char * fmt, ... ) *messageQueueTail = newmsg; messageQueueTail = &newmsg->next; + + if( strstr( file, "fdlimit.c" ) ) + fprintf( stderr, "%s\n", text ); } else {