Skip to content

Commit

Permalink
usr/transport/tcp: Print exact error we got from epoll
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Burman <[email protected]>
  • Loading branch information
yanburman committed Jan 23, 2024
1 parent 731df43 commit c5181d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/usr/transport/tcp/xio_tcp_management.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,11 @@ void xio_tcp_data_ready_ev_handler(int fd, int events, void *user_context)
}

if (events & (XIO_POLLHUP | XIO_POLLRDHUP | XIO_POLLERR)) {
DEBUG_LOG("epoll returned with error events=%d for fd=%d\n",
events, fd);
int so_error;
socklen_t so_error_len = sizeof(so_error);
int ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &so_error, &so_error_len);
DEBUG_LOG("epoll returned with error=%d events=%d for fd=%d (ret=%d)\n",
so_error, events, fd, ret);
xio_tcp_disconnect_helper(tcp_hndl);
}
}
Expand Down

0 comments on commit c5181d5

Please sign in to comment.