53 if (!estr) estr =
"reason unknown";
54 else if (isupper(
static_cast<int>(*estr)))
55 {
strlcpy(ebuff, estr,
sizeof(ebuff));
56 *ebuff =
static_cast<char>(tolower(
static_cast<int>(*estr)));
62 if (!etxt2) etxt2 = esep =
"";
66 n = snprintf(buff, blen,
"Unable to %s%s%s; %s",etxt1,esep,etxt2,estr);
67 return (n < blen ? n : blen-1);
75 const char *esfx,
int ecode,
76 const char *etxt1,
const char *etxt2)
83 elen =
Format(ebuff,
sizeof(ebuff), ecode, etxt1, etxt2);
87 if (elog) elog->
Emsg(esfx, ebuff);
88 if (estrm) estrm->
Put(ebuff, elen);
92 if (ecode)
return (ecode < 0 ? ecode : -ecode);
static int Format(char *buff, int blen, int ecode, const char *etxt1, const char *etxt2=0)
static int Route(XrdSysError *elog, XrdOucStream *estrm, const char *esfx, int ecode, const char *etxt1, const char *etxt2=0)
int Put(const char *data, const int dlen)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
static const char * ec2text(int ecode)