From 4379e844b02eefd58cd1e5372e455787d17f1780 Mon Sep 17 00:00:00 2001 From: Alja Mrak-Tadel Date: Thu, 9 Jun 2016 10:32:35 -0700 Subject: [PATCH] Add log message in Read() when 0 bytes read. --- src/XrdFileCache/XrdFileCacheInfo.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/XrdFileCache/XrdFileCacheInfo.cc b/src/XrdFileCache/XrdFileCacheInfo.cc index cda22389e63..b9c2951d8ac 100644 --- a/src/XrdFileCache/XrdFileCacheInfo.cc +++ b/src/XrdFileCache/XrdFileCacheInfo.cc @@ -99,9 +99,13 @@ int Info::Read(XrdOssDF* fp) int off = 0; int version; - off += fp->Read(&version, off, sizeof(int)); + off = fp->Read(&version, off, sizeof(int)); + if (off <= 0) { + TRACE(Warning, "Info:::Read() failed"); + return 0; + } if (version != m_version) { - TRACE(Error, "Info:::Read(), incomatible file version"); + TRACE(Error, "Info:::Read(), incompatible file version"); return 0; }