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/connect-ppc64.patch | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 user/libcddb/connect-ppc64.patch (limited to 'user/libcddb/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-60-g2f50