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

Pass the environment pointer internally in XrdCksManOss #1319

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 5 additions & 2 deletions src/XrdCks/XrdCksManOss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int XrdCksManOss::Calc(const char *Lfn, XrdCksData &Cks, int doSet)

/******************************************************************************/

int XrdCksManOss::Calc(const char *Pfn, time_t &MTime, XrdCksCalc *csP)
int XrdCksManOss::Calc(const char *Pfn, time_t &MTime, XrdCksCalc *csP, XrdOucEnv *envP)
{
class inFile
{public:
Expand All @@ -127,9 +127,12 @@ int XrdCksManOss::Calc(const char *Pfn, time_t &MTime, XrdCksCalc *csP)
size_t ioSize, calcSize;
int rc;

if (envP) {eDest->Emsg("XrdCksManOss::Calc", "Got envP");}
else {eDest->Emsg("XrdCksManOss::Calc", "No envP");}

// Open the input file
//
if ((rc = In.fP->Open(Lfn,O_RDONLY,0,openEnv))) return (rc > 0 ? -rc : rc);
if ((rc = In.fP->Open(Lfn,O_RDONLY,0, envP ? *envP : openEnv))) return (rc > 0 ? -rc : rc);

// Get the file characteristics
//
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCks/XrdCksManOss.hh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ virtual int Ver( const char *Lfn, XrdCksData &Cks);
virtual ~XrdCksManOss() {}

protected:
virtual int Calc(const char *Lfn, time_t &MTime, XrdCksCalc *CksObj);
virtual int Calc(const char *Lfn, time_t &MTime, XrdCksCalc *CksObj, XrdOucEnv *envP);
virtual int ModTime(const char *Pfn, time_t &MTime);

private:
Expand Down
4 changes: 2 additions & 2 deletions src/XrdCks/XrdCksManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int XrdCksManager::Calc(const char *Pfn, XrdCksData &Cks, int doSet)

// Use the calculator to get and possibly set the checksum
//
if (!(rc = Calc(Pfn, MTime, csP)))
if (!(rc = Calc(Pfn, MTime, csP, Cks.envP)))
{memcpy(Cks.Value, csP->Final(), csIP->Len);
Cks.fmTime = static_cast<long long>(MTime);
Cks.csTime = static_cast<int>(time(0) - MTime);
Expand All @@ -147,7 +147,7 @@ int XrdCksManager::Calc(const char *Pfn, XrdCksData &Cks, int doSet)

/******************************************************************************/

int XrdCksManager::Calc(const char *Pfn, time_t &MTime, XrdCksCalc *csP)
int XrdCksManager::Calc(const char *Pfn, time_t &MTime, XrdCksCalc *csP, XrdOucEnv*)
{
class ioFD
{public:
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCks/XrdCksManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected:
Otherwise, it returns -errno. The default implementation uses
open(), fstat(), mmap(), and unmap() to calculate the results.
*/
virtual int Calc(const char *Pfn, time_t &MTime, XrdCksCalc *CksObj);
virtual int Calc(const char *Pfn, time_t &MTime, XrdCksCalc *CksObj, XrdOucEnv *envP);

/* ModTime() returns 0 and places file's modification time in MTime. Otherwise,
it return -errno. The default implementation uses stat().
Expand Down