diff options
Diffstat (limited to 'net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch')
-rw-r--r-- | net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch b/net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch deleted file mode 100644 index 214c78570c04..000000000000 --- a/net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch +++ /dev/null @@ -1,33 +0,0 @@ -# Fixes a crash in epoll due to libcurl/c-ares bug: -# PollEPoll::modify(...) epoll_ctl call failed -Index: libtorrent/src/torrent/poll_epoll.cc -=================================================================== ---- libtorrent/src/torrent/poll_epoll.cc (revision 1067) -+++ libtorrent/src/torrent/poll_epoll.cc (working copy) -@@ -75,12 +75,21 @@ - - set_event_mask(event, mask); - -- // If error is EEXIST, try again with EPOLL_CTL_MOD. -- // libcurl with c-ares may unwittingly re-open an FD closed by -- // c-ares before notified (and thus notifying us) of its closure. - if (epoll_ctl(m_fd, op, event->file_descriptor(), &e)) { -- if (op != EPOLL_CTL_ADD || errno != EEXIST || -- epoll_ctl(m_fd, EPOLL_CTL_MOD, event->file_descriptor(), &e)) -+ // Socket was probably already closed. Ignore this. -+ if (op == EPOLL_CTL_DEL && errno == ENOENT) -+ return; -+ -+ // Handle some libcurl/c-ares bugs by retrying once. -+ if (op == EPOLL_CTL_ADD && errno == EEXIST) { -+ op = EPOLL_CTL_MOD; -+ errno = 0; -+ } else if (op == EPOLL_CTL_MOD && errno == ENOENT) { -+ op = EPOLL_CTL_ADD; -+ errno = 0; -+ } -+ -+ if (errno || epoll_ctl(m_fd, op, event->file_descriptor(), &e)) - throw internal_error("PollEPoll::modify(...) epoll_ctl call failed"); - } - } |