From 77af0b475f16c635b91ce5f38278eea71768b849 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Sat, 11 Aug 2007 13:39:36 +0000 Subject: Sort of addressed a concorrency issue when receiving mutliple SIG_HUPs --- opentracker.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'opentracker.c') diff --git a/opentracker.c b/opentracker.c index ff1c1c6..d97e73e 100644 --- a/opentracker.c +++ b/opentracker.c @@ -759,15 +759,19 @@ static void ot_try_bind( char ip[4], uint16 port, int is_tcp ) { #ifdef WANT_BLACKLISTING /* Read initial black list */ void read_blacklist_file( int foo ) { - FILE * blacklist_filehandle = fopen( blacklist_filename, "r" ); + FILE * blacklist_filehandle; ot_hash infohash; foo = foo; + signal( SIGHUP, SIG_IGN ); + blacklist_filehandle = fopen( blacklist_filename, "r" ); + /* Free blacklist vector in trackerlogic.c*/ blacklist_reset(); if( blacklist_filehandle == NULL ) { fprintf( stderr, "Warning: Can't open blacklist file: %s (but will try to create it later, if necessary and possible).", blacklist_filename ); + signal( SIGHUP, read_blacklist_file ); return; } @@ -789,7 +793,9 @@ void read_blacklist_file( int foo ) { ignore_line: continue; } + fclose( blacklist_filehandle ); + signal( SIGHUP, read_blacklist_file ); } #endif -- cgit v1.2.3