Ticket #2755: 0001-Close-file-descriptors-as-the-last-thing-when-shutti.patch

File 0001-Close-file-descriptors-as-the-last-thing-when-shutti.patch, 1.2 KB (added by wereHamster, 12 years ago)
  • libtransmission/session.c

    From 4c95b5c0711a0b351e0c02608fee16938e9777dd Mon Sep 17 00:00:00 2001
    From: Tomas Carnecky <tom@dbservice.com>
    Date: Thu, 14 Jan 2010 08:19:34 +0100
    Subject: [PATCH] Close file descriptors as the last thing when shutting down
    
    We need to call tr_fdClose() at least after closing all torrents, otherwise
    the assert in tr_fdTorrentClose() fails. And to be on the safe side close
    the file descriptors as the very last thing when shutting down. The fdlimit
    code doesn't depend on anything external anyway.
    
    Signed-off-by: Tomas Carnecky <tom@dbservice.com>
    ---
     libtransmission/session.c |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/libtransmission/session.c b/libtransmission/session.c
    index 9f62b53..283fefb 100644
    a b sessionCloseImpl( void * vsession ) 
    14701470
    14711471    free_incoming_peer_port( session );
    14721472
    1473     tr_fdClose( session );
    1474 
    14751473    if( session->isDHTEnabled )
    14761474        tr_dhtUninit( session );
    14771475
    sessionCloseImpl( void * vsession ) 
    15111509    closeBlocklists( session );
    15121510    tr_webClose( &session->web );
    15131511
     1512    tr_fdClose( session );
     1513
    15141514    session->isClosed = TRUE;
    15151515}
    15161516