Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OssCsi] Fix some incorrect conversion of return values #1443

Merged
merged 1 commit into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/XrdOssCsi/XrdOssCsiFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,13 @@ ssize_t XrdOssCsiFile::WriteV(XrdOucIOVec *writeV, int n)
}
}
// standard OSS gives -ESPIPE in case of partial write of an element
int ret = successor_->WriteV(writeV, n);
if (ret<0)
ssize_t wret = successor_->WriteV(writeV, n);
if (wret<0)
{
rg.ReleaseAll();
resyncSizes();
}
return ret;
return wret;
}

ssize_t XrdOssCsiFile::pgRead(void *buffer, off_t offset, size_t rdlen, uint32_t *csvec, uint64_t opts)
Expand Down
12 changes: 6 additions & 6 deletions src/XrdOssCsi/XrdOssCsiPages.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ int XrdOssCsiPages::VerifyRange(XrdOssDF *const fd, const void *buff, const off_
// if the tag file is missing we don't verify anything
if (hasMissingTags_)
{
return blen;
return 0;
}

const Sizes_t sizes = rg.getTrackinglens();
Expand All @@ -254,7 +254,7 @@ int XrdOssCsiPages::VerifyRange(XrdOssDF *const fd, const void *buff, const off_
return -EDOM;
}

ssize_t vret;
int vret;
if ((offset % XrdSys::PageSize) != 0 || (offset+blen != static_cast<size_t>(trackinglen) && (blen % XrdSys::PageSize) != 0))
{
vret = VerifyRangeUnaligned(fd, buff, offset, blen, sizes);
Expand Down Expand Up @@ -642,7 +642,7 @@ int XrdOssCsiPages::FetchRange(
{
pgDoCalc(buff, offset, blen, csvec);
}
return blen;
return 0;
}

const Sizes_t sizes = rg.getTrackinglens();
Expand Down Expand Up @@ -671,10 +671,10 @@ int XrdOssCsiPages::FetchRange(
{
// if the crc values are not wanted nor checks against data, then
// there's nothing more to do here
return blen;
return 0;
}

ssize_t fret;
int fret;
if ((offset % XrdSys::PageSize) != 0 || (offset+blen != static_cast<size_t>(trackinglen) && (blen % XrdSys::PageSize) != 0))
{
fret = FetchRangeUnaligned(fd, buff, offset, blen, sizes, csvec, opts);
Expand Down Expand Up @@ -708,7 +708,7 @@ int XrdOssCsiPages::StoreRange(XrdOssDF *const fd, const void *buff, const off_t
{
pgDoCalc(buff, offset, blen, csvec);
}
return blen;
return 0;
}

const Sizes_t sizes = rg.getTrackinglens();
Expand Down
2 changes: 1 addition & 1 deletion src/XrdOssCsi/XrdOssCsiTagstoreFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int XrdOssCsiTagstoreFile::Open(const char *path, const off_t dsize, const int O

uint32_t magic;

const int mread = XrdOssCsiTagstoreFile::fullread(*fd_, header_, 0, 20);
const ssize_t mread = XrdOssCsiTagstoreFile::fullread(*fd_, header_, 0, 20);
bool mok = false;
if (mread >= 0)
{
Expand Down