From 30bb6b3ecf4dc6d98b9a0f98de9dd63e244d73ee Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 7 Apr 2009 04:23:04 +0000 Subject: [PATCH] (trunk libT) yet another fix found by RolCol --- libtransmission/verify.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libtransmission/verify.c b/libtransmission/verify.c index be6a0768d..a72ca634c 100644 --- a/libtransmission/verify.c +++ b/libtransmission/verify.c @@ -76,7 +76,8 @@ verifyTorrent( tr_torrent * tor, tr_bool * stopFlag ) char * filename = tr_buildPath( tor->downloadDir, file->name, NULL ); fp = fopen( filename, "rb" ); #ifdef HAVE_POSIX_FADVISE - posix_fadvise( fileno( fp ), 0, 0, POSIX_FADV_SEQUENTIAL ); + if( fp != NULL ) + posix_fadvise( fileno( fp ), 0, 0, POSIX_FADV_SEQUENTIAL ); #endif /* fprintf( stderr, "opening file #%d (%s) -- %p\n", fileIndex, filename, fp ); */ tr_free( filename ); -- 2.40.0