Skip to content

Commit

Permalink
Set errno to be positive (stored as negative in respnse handlers). Ad…
Browse files Browse the repository at this point in the history
…d info printout in File::ioActive().
  • Loading branch information
osschar committed Sep 19, 2016
1 parent 3dcee51 commit 5b93745
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions src/XrdFileCache/XrdFileCacheFile.cc
Expand Up @@ -143,8 +143,7 @@ bool File::ioActive()
{
// Retruns true if delay is needed

TRACEF(Debug, "File::Initiate close start");

TRACEF(Debug, "File::ioActive start");

// remove failed blocks and check if map is empty
m_downloadCond.Lock();
Expand All @@ -155,14 +154,15 @@ bool File::ioActive()
cache()->DeRegisterPrefetchFile(this);
}

/*
// high debug print
for (BlockMap_i it = m_block_map.begin(); it != m_block_map.end(); ++it) {
Block* b = it->second;
TRACEF(Dump, "File::InitiateClose() block idx = " << b->m_offset/m_cfi.GetBufferSize() << " prefetch = " << b->preferch << " refcnt " << b->refcnt);

}
*/
// High debug print
// for (BlockMap_i it = m_block_map.begin(); it != m_block_map.end(); ++it)
// {
// Block* b = it->second;
// TRACEF(Dump, "File::ioActive block idx = " << b->m_offset/m_cfi.GetBufferSize() << " prefetch = " << b->prefetch << " refcnt " << b->refcnt);
// }
TRACEF(Info, "ioActive block_map.size() = " << m_block_map.size());

BlockMap_i itr = m_block_map.begin();
while (itr != m_block_map.end())
{
Expand Down Expand Up @@ -625,7 +625,7 @@ int File::Read(char* iUserBuff, long long iUserOff, int iUserSize)
else // it has failed ... krap up.
{
bytes_read = -1;
errno = (*bi)->m_errno;
errno = - (*bi)->m_errno;
TRACEF(Error, "File::Read(), block "<< (*bi)->m_offset/BS << " finished with error "
<< errno << " " << strerror(errno));
break;
Expand Down Expand Up @@ -655,7 +655,7 @@ int File::Read(char* iUserBuff, long long iUserOff, int iUserSize)
}
else
{
errno = direct_handler->m_errno;
errno = - direct_handler->m_errno;
bytes_read = -1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/XrdFileCache/XrdFileCacheFile.hh
Expand Up @@ -63,7 +63,7 @@ namespace XrdFileCache
File *m_file;
bool m_prefetch;
int m_refcnt;
int m_errno;
int m_errno; // stores negative errno
bool m_downloaded;

Block(File *f, long long off, int size, bool m_prefetch) :
Expand Down
4 changes: 2 additions & 2 deletions src/XrdFileCache/XrdFileCacheVRead.cc
Expand Up @@ -160,7 +160,7 @@ int File::ReadV(const XrdOucIOVec *readV, int n)
}
else
{
errno = direct_handler->m_errno;
errno = - direct_handler->m_errno;
bytesRead = -1;
}
}
Expand Down Expand Up @@ -366,7 +366,7 @@ int File::VReadProcessBlocks(const XrdOucIOVec *readV, int n,
else
{
bytes_read = -1;
errno = bi->block->m_errno;
errno = - bi->block->m_errno;
break;
}

Expand Down

0 comments on commit 5b93745

Please sign in to comment.