diff --git a/io/src/TFileCacheRead.cxx b/io/src/TFileCacheRead.cxx index f3771f9e7fd58f5405d75ef56a4a30f709ff24bf..8cca6f7ebbbb44a70531a4da895daf797f6a67e9 100644 --- a/io/src/TFileCacheRead.cxx +++ b/io/src/TFileCacheRead.cxx @@ -93,12 +93,13 @@ TFileCacheRead::TFileCacheRead(TFile *file, Int_t buffersize) fFirstIndexToPrefetch = 0; fAsyncReading = gEnv->GetValue("TFile.AsyncReading", 1); if (fAsyncReading) { - // If asynchronous reading is not supported by this TFile specialization + // Check if asynchronous reading is supported by this TFile specialization + fAsyncReading = kFALSE; + if (file && !(file->ReadBufferAsync(0, 0))) + fAsyncReading = kTRUE; + } else { // we use sync primitives, hence we need the local buffer - if (file && file->ReadBufferAsync(0, 0)) { - fAsyncReading = kFALSE; - fBuffer = new char[fBufferSize]; - } + fBuffer = new char[fBufferSize]; } fIsSorted = kFALSE;