summaryrefslogtreecommitdiff
path: root/user/libcddb/connect-ppc64.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-03 07:35:24 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-03 07:35:24 +0000
commit23931e68295808b529cab095c98f0055991aa44b (patch)
treed5e416f7d6b3d6ec59be0f675efbcb0d056ca76a /user/libcddb/connect-ppc64.patch
parent8a2f909780210d0af38de3ce537c1b5b57e0f6f2 (diff)
downloadpackages-23931e68295808b529cab095c98f0055991aa44b.tar.gz
packages-23931e68295808b529cab095c98f0055991aa44b.tar.bz2
packages-23931e68295808b529cab095c98f0055991aa44b.tar.xz
packages-23931e68295808b529cab095c98f0055991aa44b.zip
user/libcddb: workaround kernel bug
Diffstat (limited to 'user/libcddb/connect-ppc64.patch')
-rw-r--r--user/libcddb/connect-ppc64.patch41
1 files changed, 41 insertions, 0 deletions
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 */