Skip to content

Commit c5181d5

Browse files
committed
usr/transport/tcp: Print exact error we got from epoll
Signed-off-by: Yan Burman <yanburman@users.noreply.github.com>
1 parent 731df43 commit c5181d5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/usr/transport/tcp/xio_tcp_management.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,11 @@ void xio_tcp_data_ready_ev_handler(int fd, int events, void *user_context)
672672
}
673673

674674
if (events & (XIO_POLLHUP | XIO_POLLRDHUP | XIO_POLLERR)) {
675-
DEBUG_LOG("epoll returned with error events=%d for fd=%d\n",
676-
events, fd);
675+
int so_error;
676+
socklen_t so_error_len = sizeof(so_error);
677+
int ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &so_error, &so_error_len);
678+
DEBUG_LOG("epoll returned with error=%d events=%d for fd=%d (ret=%d)\n",
679+
so_error, events, fd, ret);
677680
xio_tcp_disconnect_helper(tcp_hndl);
678681
}
679682
}

0 commit comments

Comments
 (0)