Skip to content

Commit

Permalink
[Server] Obtain the real path for spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
abh3 committed Jun 3, 2020
1 parent 0aa6169 commit 241cb8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/XrdOss/XrdOssCache.cc
Expand Up @@ -106,6 +106,7 @@ XrdOssCache_FSData::XrdOssCache_FSData(const char *fsp,
dev_t fsID)
{
path = strdup(fsp);
if (!(pact= realpath(fsp,0))) pact = path;
size = static_cast<long long>(fsbuff.f_blocks)
* static_cast<long long>(fsbuff.FS_BLKSZ);
frsz = static_cast<long long>(fsbuff.f_bavail)
Expand Down Expand Up @@ -672,7 +673,7 @@ int XrdOssCache::Init(long long aMin, int ovhd, int aFuzz)
void XrdOssCache::List(const char *lname, XrdSysError &Eroute)
{
XrdOssCache_FS *fsp;
const char *theCmd;
const char *theCmd, *rpath;
char *pP, buff[4096];

if ((fsp = fsfirst)) do
Expand All @@ -681,9 +682,11 @@ void XrdOssCache::List(const char *lname, XrdSysError &Eroute)
do {pP--;} while(*pP != '/');
*pP = '\0'; theCmd = "space";
} else {pP=0; theCmd = "cache";}
snprintf(buff, sizeof(buff), "%s%s %s %s -> %s[%d:%d]", lname, theCmd,
fsp->group, fsp->path, fsp->fsdata->devN,
fsp->fsdata->bdevID, fsp->fsdata->partID);
rpath = (strcmp(fsp->fsdata->path, fsp->fsdata->pact)
? fsp->fsdata->pact : "");
snprintf(buff, sizeof(buff), "%s%s %s %s -> %s[%d:%d] %s",
lname, theCmd, fsp->group, fsp->path, fsp->fsdata->devN,
fsp->fsdata->bdevID, fsp->fsdata->partID, rpath);
if (pP) *pP = '/';
Eroute.Say(buff);
fsp = fsp->next;
Expand Down
1 change: 1 addition & 0 deletions src/XrdOss/XrdOssCache.hh
Expand Up @@ -112,6 +112,7 @@ long long size;
long long frsz;
dev_t fsid;
const char *path;
const char *pact;
const char *devN;
time_t updt;
int stat;
Expand Down

0 comments on commit 241cb8d

Please sign in to comment.