Skip to content

Commit

Permalink
[Server] Add value of event mask in socket error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
abh3 committed Oct 7, 2019
1 parent a9d5483 commit 6b7ebea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Xrd/XrdPollE.icc
Expand Up @@ -195,6 +195,7 @@ void XrdPollE::remFD(XrdLink *lp, unsigned int events)
{
struct epoll_event myEvents = {0, {(void *)lp}};
static const char *why;
static char buff[32];

// It works out that ONESHOT mode or even CTL_MOD requests do not necessarily
// prevent epoll_wait() from returning on an error event. So, we must manually
Expand All @@ -204,7 +205,8 @@ void XrdPollE::remFD(XrdLink *lp, unsigned int events)
if (events & (EPOLLHUP | EPOLLRDHUP)) why = "Sever";
else if (events & EPOLLERR) why = "Error";
else why = "Disabled";
XrdLog->Emsg("Poll", why, "event occured for", lp->ID);
snprintf(buff, sizeof(buff), "%s (%x)", why, events);
XrdLog->Emsg("Poll", buff, "event occured for", lp->ID);

if (epoll_ctl(PollDfd, EPOLL_CTL_DEL, lp->FDnum(), &myEvents))
XrdLog->Emsg("Poll", errno, "exclude link", lp->ID);
Expand Down

0 comments on commit 6b7ebea

Please sign in to comment.