From bd6592e78b43b0b2c5fa945ebe276888fa4872b0 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 9 Jan 2018 03:23:47 +0300 Subject: [PATCH] Add epoll debug. GitOrigin-RevId: f10adc3fdf4c91adf8dc5be6998466cb84e7f876 --- tdutils/td/utils/port/detail/Epoll.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tdutils/td/utils/port/detail/Epoll.cpp b/tdutils/td/utils/port/detail/Epoll.cpp index ef5e808e6..2ef026d16 100644 --- a/tdutils/td/utils/port/detail/Epoll.cpp +++ b/tdutils/td/utils/port/detail/Epoll.cpp @@ -53,13 +53,16 @@ void Epoll::subscribe(const Fd &fd, Fd::Flags flags) { event.data.fd = native_fd; int err = epoll_ctl(epoll_fd, EPOLL_CTL_ADD, native_fd, &event); auto epoll_ctl_errno = errno; - LOG_IF(FATAL, err == -1) << Status::PosixError(epoll_ctl_errno, "epoll_ctl ADD failed"); + LOG_IF(FATAL, err == -1) << Status::PosixError(epoll_ctl_errno, "epoll_ctl ADD failed") << ", epoll_fd = " << epoll_fd + << ", fd = " << native_fd; } void Epoll::unsubscribe(const Fd &fd) { - int err = epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd.get_native_fd(), nullptr); + auto native_fd = fd.get_native_fd(); + int err = epoll_ctl(epoll_fd, EPOLL_CTL_DEL, native_fd, nullptr); auto epoll_ctl_errno = errno; - LOG_IF(FATAL, err == -1) << Status::PosixError(epoll_ctl_errno, "epoll_ctl DEL failed"); + LOG_IF(FATAL, err == -1) << Status::PosixError(epoll_ctl_errno, "epoll_ctl DEL failed") << ", epoll_fd = " << epoll_fd + << ", fd = " << native_fd; } void Epoll::unsubscribe_before_close(const Fd &fd) {