summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/libtorrent/ChangeLog8
-rw-r--r--net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch33
-rw-r--r--net-libs/libtorrent/libtorrent-0.12.3.ebuild50
3 files changed, 90 insertions, 1 deletions
diff --git a/net-libs/libtorrent/ChangeLog b/net-libs/libtorrent/ChangeLog
index 622ab3b46842..21c5631b0219 100644
--- a/net-libs/libtorrent/ChangeLog
+++ b/net-libs/libtorrent/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-libs/libtorrent
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-libs/libtorrent/ChangeLog,v 1.123 2008/08/26 21:17:15 loki_val Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libtorrent/ChangeLog,v 1.124 2008/09/16 07:11:42 loki_val Exp $
+
+*libtorrent-0.12.3 (16 Sep 2008)
+
+ 16 Sep 2008; Peter Alfredsen <loki_val@gentoo.org>
+ +files/libtorrent-0.12.3-fix-epoll-crash.patch, +libtorrent-0.12.3.ebuild:
+ rtorrent-0.8.3/libtorrent-0.12.3 bump
*libtorrent-0.12.2-r4 (26 Aug 2008)
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
new file mode 100644
index 000000000000..214c78570c04
--- /dev/null
+++ b/net-libs/libtorrent/files/libtorrent-0.12.3-fix-epoll-crash.patch
@@ -0,0 +1,33 @@
+# 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");
+ }
+ }
diff --git a/net-libs/libtorrent/libtorrent-0.12.3.ebuild b/net-libs/libtorrent/libtorrent-0.12.3.ebuild
new file mode 100644
index 000000000000..1906b741fd04
--- /dev/null
+++ b/net-libs/libtorrent/libtorrent-0.12.3.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libtorrent/libtorrent-0.12.3.ebuild,v 1.1 2008/09/16 07:11:42 loki_val Exp $
+
+inherit base eutils toolchain-funcs flag-o-matic libtool
+
+DESCRIPTION="LibTorrent is a BitTorrent library written in C++ for *nix."
+HOMEPAGE="http://libtorrent.rakshasa.no/"
+SRC_URI="http://libtorrent.rakshasa.no/downloads/${P}.tar.gz"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+
+IUSE="debug ipv6"
+
+RDEPEND=">=dev-libs/libsigc++-2"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig"
+
+PATCHES=( "${FILESDIR}/${P}-fix-epoll-crash.patch" )
+
+src_unpack() {
+ base_src_unpack
+ cd "${S}"
+ elibtoolize #Don't remove. Needed for *bsd.
+}
+
+src_compile() {
+ replace-flags -Os -O2
+
+ if [[ $(tc-arch) = "x86" ]]; then
+ filter-flags -fomit-frame-pointer -fforce-addr
+ fi
+
+ econf \
+ $(use_enable debug) \
+ $(use_enable ipv6) \
+ --enable-aligned \
+ --enable-static \
+ --enable-shared \
+ --disable-dependency-tracking \
+ || die "econf failed"
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ dodoc AUTHORS NEWS README
+}