]> granicus.if.org Git - transmission/commitdiff
(trunk libT) yet another fix found by RolCol
authorCharles Kerr <charles@transmissionbt.com>
Tue, 7 Apr 2009 04:23:04 +0000 (04:23 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Tue, 7 Apr 2009 04:23:04 +0000 (04:23 +0000)
libtransmission/verify.c

index be6a0768daa273d2ad88ba563d9137a814435818..a72ca634c39fecc1937a199101ad46960e3b6d54 100644 (file)
@@ -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 );