]> granicus.if.org Git - transmission/commitdiff
(trunk libT) remove dead code
authorCharles Kerr <charles@transmissionbt.com>
Fri, 17 Jul 2009 17:23:03 +0000 (17:23 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Fri, 17 Jul 2009 17:23:03 +0000 (17:23 +0000)
libtransmission/fdlimit.c

index b0bf127614dd6041602a6b963801b4d032419205..e875aad7c0cd5cbcd587bcbf546135e42e1c6788 100644 (file)
@@ -83,7 +83,6 @@ enum
 
 struct tr_openfile
 {
-    tr_bool    isCheckedOut;
     tr_bool    isWritable;
     int        torrentId;
     char       filename[MAX_PATH_LENGTH];
@@ -375,13 +374,6 @@ TrCloseFile( struct tr_openfile * o )
 
     tr_close_file( o->fd );
     o->fd = -1;
-    o->isCheckedOut = FALSE;
-}
-
-static int
-fileIsCheckedOut( const struct tr_openfile * o )
-{
-    return fileIsOpen( o ) && o->isCheckedOut;
 }
 
 /* returns an fd on success, or a -1 on failure and sets errno */
@@ -417,8 +409,6 @@ tr_fdFileCheckout( int                      torrentId,
         if( strcmp( filename, o->filename ) )
             continue;
 
-        assert( !fileIsCheckedOut( o ) );
-
         if( doWrite && !o->isWritable )
         {
             dbgmsg( "found it!  it's open and available, but isn't writable. closing..." );
@@ -483,7 +473,6 @@ tr_fdFileCheckout( int                      torrentId,
 
     dbgmsg( "checking out '%s' in slot %d", filename, winner );
     o->torrentId = torrentId;
-    o->isCheckedOut = 1;
     o->date = tr_date( );
     return o->fd;
 }
@@ -499,7 +488,6 @@ tr_fdFileReturn( int fd )
         if( o->fd != fd )
             continue;
         dbgmsg( "releasing file \"%s\"", o->filename );
-        o->isCheckedOut = FALSE;
         break;
     }
 }
@@ -515,7 +503,6 @@ tr_fdFileClose( const char * filename )
         if( !fileIsOpen( o ) || strcmp( filename, o->filename ) )
             continue;
         dbgmsg( "tr_fdFileClose closing \"%s\"", filename );
-        assert( !o->isCheckedOut && "this is a test assertion... I *think* this is always true now" );
         TrCloseFile( o );
     }
 }