From 23931e68295808b529cab095c98f0055991aa44b Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 3 Jan 2019 07:35:24 +0000 Subject: user/libcddb: workaround kernel bug --- user/libcddb/APKBUILD | 9 ++++++--- user/libcddb/connect-ppc64.patch | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 user/libcddb/connect-ppc64.patch (limited to 'user') diff --git a/user/libcddb/APKBUILD b/user/libcddb/APKBUILD index de8b4f6ff..f28442f59 100644 --- a/user/libcddb/APKBUILD +++ b/user/libcddb/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: pkgname=libcddb pkgver=1.3.2 -pkgrel=4 +pkgrel=5 pkgdesc="Library that implements the different protocols (CDDBP, HTTP, SMTP) to access data on a CDDB server (e.g. http://freedb.org)." url="https://sourceforge.net/projects/libcddb/" arch="all" @@ -12,7 +12,9 @@ license="LGPL-2.0+" depends="" makedepends="" subpackages="$pkgname-dev" -source="https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2" +source="https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2 + connect-ppc64.patch + " prepare() { cd "$builddir" @@ -37,4 +39,5 @@ package() { make DESTDIR="$pkgdir" install } -sha512sums="0e07e7d37f2013164d75b530a5528f54847271fd20f3b7bedb192a05d1f61dcf006d10dc2927efe155a01eddcc57b940bc31d8ac88d5dfc4f1a09771caa84e0a libcddb-1.3.2.tar.bz2" +sha512sums="0e07e7d37f2013164d75b530a5528f54847271fd20f3b7bedb192a05d1f61dcf006d10dc2927efe155a01eddcc57b940bc31d8ac88d5dfc4f1a09771caa84e0a libcddb-1.3.2.tar.bz2 +70f6644c7b4f40d556d81b87bcdf7a07b96f48dd741a25c6918c44bc38edd2598cc46f50a23d7c77ea8d98c9193c7ef589c277801a7ac098e9845b0a7f086993 connect-ppc64.patch" diff --git a/user/libcddb/connect-ppc64.patch b/user/libcddb/connect-ppc64.patch new file mode 100644 index 000000000..0c79fdc4d --- /dev/null +++ b/user/libcddb/connect-ppc64.patch @@ -0,0 +1,41 @@ +--- libcddb-1.3.2/lib/cddb_net.c.old 2009-03-01 03:28:07.000000000 +0000 ++++ libcddb-1.3.2/lib/cddb_net.c 2019-01-03 06:43:42.480000000 +0000 +@@ -273,7 +273,7 @@ + int timeout_connect(int sockfd, const struct sockaddr *addr, + size_t len, int timeout) + { +- int got_error = 0; ++ int got_error = 0, conn_result; + + /* set socket to non-blocking */ + #ifdef BEOS +@@ -299,7 +299,7 @@ + #endif /* BEOS */ + + /* try connecting */ +- if (connect(sockfd, addr, len) == -1) { ++ if ((conn_result = connect(sockfd, addr, len)) == -1) { + /* check whether we can continue */ + if (errno == EINPROGRESS) { + int rv; +@@ -333,6 +333,9 @@ + } + } + } ++ } else if (conn_result == 0) { ++ /* it worked without needing timeout */ ++ got_error = 0; + } else { + /* connect failed */ + got_error = -1; +--- libcddb-1.3.2/lib/cddb_net.c.old 2009-03-01 03:28:07.000000000 +0000 ++++ libcddb-1.3.2/lib/cddb_net.c 2019-01-03 07:30:27.050000000 +0000 +@@ -325,6 +325,8 @@ + default: + /* we got connected, check error condition */ + l = sizeof(rv); ++ /* Work around Linux/ppc64 bug */ ++ rv = 0; + getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &rv, &l); + if (rv) { + /* something went wrong, simulate normal connect behaviour */ -- cgit v1.2.3-70-g09d2