summaryrefslogtreecommitdiff
path: root/databases/mysql55-client
diff options
context:
space:
mode:
authorryoon <ryoon>2014-07-18 13:42:24 +0000
committerryoon <ryoon>2014-07-18 13:42:24 +0000
commit8b17b82078a60775f9214cded7cbde5f36682f06 (patch)
tree8ccd7cf948aad30e6900ede453dd8abd74e23b49 /databases/mysql55-client
parent1d9a7050bedd69a4ce7071039215543036eb3e86 (diff)
downloadpkgsrc-8b17b82078a60775f9214cded7cbde5f36682f06.tar.gz
Fix build under SCO OpenServer 5.0.7/3.2.
Diffstat (limited to 'databases/mysql55-client')
-rw-r--r--databases/mysql55-client/Makefile.common10
-rw-r--r--databases/mysql55-client/distinfo10
-rw-r--r--databases/mysql55-client/patches/patch-client_mysqladmin.cc18
-rw-r--r--databases/mysql55-client/patches/patch-client_mysqlshow.c16
-rw-r--r--databases/mysql55-client/patches/patch-include_violite.h32
-rw-r--r--databases/mysql55-client/patches/patch-mysys_my__getopt.c16
-rw-r--r--databases/mysql55-client/patches/patch-strtoll.c163
-rw-r--r--databases/mysql55-client/patches/patch-strtoull.c136
-rw-r--r--databases/mysql55-client/patches/patch-vio_viosocket.c55
9 files changed, 449 insertions, 7 deletions
diff --git a/databases/mysql55-client/Makefile.common b/databases/mysql55-client/Makefile.common
index e462c3c3e59..5c454389763 100644
--- a/databases/mysql55-client/Makefile.common
+++ b/databases/mysql55-client/Makefile.common
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.37 2014/06/02 07:17:31 adam Exp $
+# $NetBSD: Makefile.common,v 1.38 2014/07/18 13:42:24 ryoon Exp $
#
# used by databases/mysql55-client/Makefile
# used by databases/mysql55-server/Makefile
@@ -96,9 +96,15 @@ CFLAGS+= -DHAVE_CURSES_H
CXXFLAGS+= -DHAVE_CURSES_H
.endif
+# SCO OpenServer 5.0.7/3.2's readdir_r has 2 arguments and return struct dirent.
+.if ${OS_VARIANT} == "SCOOSR5"
+CMAKE_ARGS+= -DHAVE_READDIR_R=OFF
+.endif
+
.include "../../mk/pthread.buildlink3.mk"
-.if defined(PTHREAD_TYPE) && (${PTHREAD_TYPE} == "pth")
+.if (defined(PTHREAD_TYPE) && (${PTHREAD_TYPE} == "pth")) || \
+ ${OS_VARIANT} == "SCOOSR5"
CFLAGS+= -DSIGNALS_DONT_BREAK_READ
CXXFLAGS+= -DSIGNALS_DONT_BREAK_READ
.endif
diff --git a/databases/mysql55-client/distinfo b/databases/mysql55-client/distinfo
index 59fb65daf74..8d1e50b8fd7 100644
--- a/databases/mysql55-client/distinfo
+++ b/databases/mysql55-client/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.33 2014/06/02 07:17:31 adam Exp $
+$NetBSD: distinfo,v 1.34 2014/07/18 13:42:24 ryoon Exp $
SHA1 (mysql-5.5.38.tar.gz) = 569c76385b24b981df35e703eefd34f9f76a2ee2
RMD160 (mysql-5.5.38.tar.gz) = 57034b4b0642de0b08a4cf4e7e2641c775485e06
@@ -6,8 +6,9 @@ Size (mysql-5.5.38.tar.gz) = 21739681 bytes
SHA1 (patch-BUILD_compile-pentium-gcov) = a1ac666efa953a98455a726e5db359c903d699b6
SHA1 (patch-CMakeLists.txt) = 632e036cd9578d0636328c2259a8529c36f2d14a
SHA1 (patch-client_completion_hash.cc) = e27fd7072a8206380f0a932b1a31d2843c985cbf
-SHA1 (patch-client_mysqladmin.cc) = 382486c2f336eed87052e682b52d1acf444452a0
+SHA1 (patch-client_mysqladmin.cc) = c640d3ca742dc1b200701d21d82d8f2093917cf2
SHA1 (patch-client_mysqlbinlog.cc) = e38abe026c10a07808ccd24b596cf13c5079e206
+SHA1 (patch-client_mysqlshow.c) = a12b06241eee91d1ec11e3b7e4f3125aa6c79905
SHA1 (patch-client_sql_string.cc) = 1547b8d3889af2831c89b97aecdbe8158711a600
SHA1 (patch-cmake_dtrace.cmake) = 5ae3284589a17a8375b8a546136965fa337f3767
SHA1 (patch-cmake_libutils.cmake) = 5d75a1762e3db6724bec2d75b45d40b17a5e9d09
@@ -18,8 +19,10 @@ SHA1 (patch-include_my_compare.h) = f45bac4b488332a668b0005751856279b67401f5
SHA1 (patch-include_my_net.h) = 162c97a87ab00b407f6796b55ef839ba2e3ac2af
SHA1 (patch-include_my_pthread.h) = 109d376b4cf5b64c5243f9e91300667441131f86
SHA1 (patch-include_myisam.h) = 475070d41b06c04c6ae692743fc1b0244afe0a88
+SHA1 (patch-include_violite.h) = 4cf2a353f6e45b43e184fb412d962307f82ef00d
SHA1 (patch-libmysql_CMakeLists.txt) = 80c8a7d1c1ed8dca49fba647aba31561981f3913
SHA1 (patch-mysql-test_CMakeLists.txt) = d089a79df443ab2d8f97e7a1334aee2098dbb892
+SHA1 (patch-mysys_my__getopt.c) = 6d03782c2ed50e9dc4cb57de9590d6734afa7d43
SHA1 (patch-mysys_stacktrace.c) = 294b043984f740b99ba25abc8256ce8ad54d84c3
SHA1 (patch-scripts_CMakeLists.txt) = 17ec1d8d5f0c9e453c64f2b59e757e645a3a1a59
SHA1 (patch-scripts_mysqld_safe.sh) = cc34d8b4a8d4b34a6766a1123782ce3d0ad64478
@@ -38,4 +41,7 @@ SHA1 (patch-storage_myisam_CMakeLists.txt) = cad3fd135d30a9d3800a9bc525595ead92f
SHA1 (patch-storage_myisammrg_CMakeLists.txt) = 7ec499b4c8a146c551fc129e86acf2a7ead8ca7b
SHA1 (patch-storage_ndb_include_util_Parser.hpp) = ca9406a8b01dffb3f515f132fa7aaef66c78f2be
SHA1 (patch-strings_decimal.c) = dafedbfbd71149890f3356f3cafa77d6d0466f0f
+SHA1 (patch-strtoll.c) = fe0c586ba0475c16df5cd6ecaae41e2c5b89c509
+SHA1 (patch-strtoull.c) = 1f334e5b89390de41594de6d22e0071ceeaed951
+SHA1 (patch-vio_viosocket.c) = 49964371be640a029c295fe4178801e9f0b6be18
SHA1 (patch-vio_viossl.c) = bc1922f1170ff55a6ed832b90c110e788b49d4be
diff --git a/databases/mysql55-client/patches/patch-client_mysqladmin.cc b/databases/mysql55-client/patches/patch-client_mysqladmin.cc
index 9912158c1db..b71af08d9c0 100644
--- a/databases/mysql55-client/patches/patch-client_mysqladmin.cc
+++ b/databases/mysql55-client/patches/patch-client_mysqladmin.cc
@@ -1,10 +1,22 @@
-$NetBSD: patch-client_mysqladmin.cc,v 1.2 2012/10/01 15:54:40 adam Exp $
+$NetBSD: patch-client_mysqladmin.cc,v 1.3 2014/07/18 13:42:24 ryoon Exp $
Redefine signals for Irix.
---- client/mysqladmin.cc.orig 2010-02-04 11:36:52.000000000 +0000
+--- client/mysqladmin.cc.orig 2014-01-14 08:16:26.000000000 +0000
+++ client/mysqladmin.cc
-@@ -332,8 +332,14 @@ int main(int argc,char *argv[])
+@@ -29,6 +29,11 @@
+ #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
+ #define MAX_TRUNC_LENGTH 3
+
++#if defined(_SCO_DS)
++#include "../strtoull.c"
++#define strtoull pkgsrc_strtoull
++#endif
++
+ char *host= NULL, *user= 0, *opt_password= 0,
+ *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
+ char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH];
+@@ -332,8 +337,14 @@ int main(int argc,char *argv[])
if (tty_password)
opt_password = get_tty_password(NullS);
diff --git a/databases/mysql55-client/patches/patch-client_mysqlshow.c b/databases/mysql55-client/patches/patch-client_mysqlshow.c
new file mode 100644
index 00000000000..a3f1d9907e3
--- /dev/null
+++ b/databases/mysql55-client/patches/patch-client_mysqlshow.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-client_mysqlshow.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $
+
+--- client/mysqlshow.c.orig 2014-01-14 08:16:26.000000000 +0000
++++ client/mysqlshow.c
+@@ -29,6 +29,11 @@
+ #include <sslopt-vars.h>
+ #include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+
++#if defined(_SCO_DS)
++#include "../strtoull.c"
++#define strtoull pkgsrc_strtoull
++#endif
++
+ static char * host=0, *opt_password=0, *user=0;
+ static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0;
+ static my_bool tty_password= 0, opt_table_type= 0;
diff --git a/databases/mysql55-client/patches/patch-include_violite.h b/databases/mysql55-client/patches/patch-include_violite.h
new file mode 100644
index 00000000000..419f8f4e647
--- /dev/null
+++ b/databases/mysql55-client/patches/patch-include_violite.h
@@ -0,0 +1,32 @@
+$NetBSD: patch-include_violite.h,v 1.1 2014/07/18 13:42:24 ryoon Exp $
+
+--- include/violite.h.orig 2014-01-14 08:16:26.000000000 +0000
++++ include/violite.h
+@@ -196,8 +196,14 @@ struct st_vio
+ HANDLE hPipe;
+ my_bool localhost; /* Are we from localhost? */
+ int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */
++#if defined(_SCO_DS)
++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage. */
++ struct sockaddr_in local; /* Local internet address */
++ struct sockaddr_in remote; /* Remote internet address */
++#else
+ struct sockaddr_storage local; /* Local internet address */
+ struct sockaddr_storage remote; /* Remote internet address */
++#endif
+ int addrLen; /* Length of remote address */
+ enum enum_vio_type type; /* Type of connection */
+ char desc[30]; /* String description */
+@@ -215,7 +221,12 @@ struct st_vio
+ int (*viokeepalive)(Vio*, my_bool);
+ int (*fastsend)(Vio*);
+ my_bool (*peer_addr)(Vio*, char *, uint16*, size_t);
++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage. */
++#if defined(_SCO_DS)
++ void (*in_addr)(Vio*, struct sockaddr_in*);
++#else
+ void (*in_addr)(Vio*, struct sockaddr_storage*);
++#endif
+ my_bool (*should_retry)(Vio*);
+ my_bool (*was_interrupted)(Vio*);
+ int (*vioclose)(Vio*);
diff --git a/databases/mysql55-client/patches/patch-mysys_my__getopt.c b/databases/mysql55-client/patches/patch-mysys_my__getopt.c
new file mode 100644
index 00000000000..4f01ec97159
--- /dev/null
+++ b/databases/mysql55-client/patches/patch-mysys_my__getopt.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-mysys_my__getopt.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $
+
+--- mysys/my_getopt.c.orig 2014-01-14 08:16:26.000000000 +0000
++++ mysys/my_getopt.c
+@@ -22,6 +22,11 @@
+ #include <errno.h>
+ #include <m_string.h>
+
++#if defined(_SCO_DS)
++#include "../strtoll.c"
++#define strtoll pkgsrc_strtoll
++#endif
++
+ typedef void (*init_func_p)(const struct my_option *option, void *variable,
+ longlong value);
+
diff --git a/databases/mysql55-client/patches/patch-strtoll.c b/databases/mysql55-client/patches/patch-strtoll.c
new file mode 100644
index 00000000000..943e02be3a1
--- /dev/null
+++ b/databases/mysql55-client/patches/patch-strtoll.c
@@ -0,0 +1,163 @@
+$NetBSD: patch-strtoll.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $
+
+--- strtoll.c.orig 2014-03-09 04:03:38.000000000 +0000
++++ strtoll.c
+@@ -0,0 +1,158 @@
++#if !defined(LLONG_MAX)
++#define LLONG_MAX 0x7fffffffffffffffLL
++#endif
++
++#if !defined(LLONG_MIN)
++#define LLONG_MIN -0x7fffffffffffffffLL-1
++#endif
++
++#if !defined(ULLONG_MAX)
++#define ULLONG_MAX 0xffffffffffffffffULL
++#endif
++
++/*-
++ * Copyright (c) 1992, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. All advertising materials mentioning features or use of this software
++ * must display the following acknowledgement:
++ * This product includes software developed by the University of
++ * California, Berkeley and its contributors.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#if 0
++#if defined(LIBC_SCCS) && !defined(lint)
++static char sccsid[] = "@(#)strtoq.c 8.1 (Berkeley) 6/4/93";
++#endif /* LIBC_SCCS and not lint */
++
++#ifndef lint
++static const char rcsid[] =
++ "$FreeBSD$";
++#endif
++#endif
++
++#include <sys/types.h>
++
++#include <limits.h>
++#include <errno.h>
++#include <ctype.h>
++#include <stdlib.h>
++
++/*
++ * Convert a string to a long long integer.
++ *
++ * Ignores `locale' stuff. Assumes that the upper and lower case
++ * alphabets and digits are each contiguous.
++ */
++long long
++pkgsrc_strtoll(nptr, endptr, base)
++ const char *nptr;
++ char **endptr;
++ register int base;
++{
++ register const char *s;
++ register unsigned long long acc;
++ register unsigned char c;
++ register unsigned long long qbase, cutoff;
++ register int neg, any, cutlim;
++
++ /*
++ * Skip white space and pick up leading +/- sign if any.
++ * If base is 0, allow 0x for hex and 0 for octal, else
++ * assume decimal; if base is already 16, allow 0x.
++ */
++ s = nptr;
++ do {
++ c = *s++;
++ } while (isspace(c));
++ if (c == '-') {
++ neg = 1;
++ c = *s++;
++ } else {
++ neg = 0;
++ if (c == '+')
++ c = *s++;
++ }
++ if ((base == 0 || base == 16) &&
++ c == '0' && (*s == 'x' || *s == 'X')) {
++ c = s[1];
++ s += 2;
++ base = 16;
++ }
++ if (base == 0)
++ base = c == '0' ? 8 : 10;
++
++ /*
++ * Compute the cutoff value between legal numbers and illegal
++ * numbers. That is the largest legal value, divided by the
++ * base. An input number that is greater than this value, if
++ * followed by a legal input character, is too big. One that
++ * is equal to this value may be valid or not; the limit
++ * between valid and invalid numbers is then based on the last
++ * digit. For instance, if the range for quads is
++ * [-9223372036854775808..9223372036854775807] and the input base
++ * is 10, cutoff will be set to 922337203685477580 and cutlim to
++ * either 7 (neg==0) or 8 (neg==1), meaning that if we have
++ * accumulated a value > 922337203685477580, or equal but the
++ * next digit is > 7 (or 8), the number is too big, and we will
++ * return a range error.
++ *
++ * Set any if any `digits' consumed; make it negative to indicate
++ * overflow.
++ */
++ qbase = (unsigned)base;
++ cutoff = neg ? (unsigned long long)-(LLONG_MIN + LLONG_MAX) + LLONG_MAX
++ : LLONG_MAX;
++ cutlim = cutoff % qbase;
++ cutoff /= qbase;
++ for (acc = 0, any = 0;; c = *s++) {
++ if (!isascii(c))
++ break;
++ if (isdigit(c))
++ c -= '0';
++ else if (isalpha(c))
++ c -= isupper(c) ? 'A' - 10 : 'a' - 10;
++ else
++ break;
++ if (c >= base)
++ break;
++ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
++ any = -1;
++ else {
++ any = 1;
++ acc *= qbase;
++ acc += c;
++ }
++ }
++ if (any < 0) {
++ acc = neg ? LLONG_MIN : LLONG_MAX;
++ errno = ERANGE;
++ } else if (neg)
++ acc = -acc;
++ if (endptr != 0)
++ *endptr = (char *)(any ? s - 1 : nptr);
++ return (acc);
++}
diff --git a/databases/mysql55-client/patches/patch-strtoull.c b/databases/mysql55-client/patches/patch-strtoull.c
new file mode 100644
index 00000000000..d7031fb598e
--- /dev/null
+++ b/databases/mysql55-client/patches/patch-strtoull.c
@@ -0,0 +1,136 @@
+$NetBSD: patch-strtoull.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $
+
+--- strtoull.c.orig 2014-03-09 04:03:38.000000000 +0000
++++ strtoull.c
+@@ -0,0 +1,131 @@
++/*-
++ * Copyright (c) 1992, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. All advertising materials mentioning features or use of this software
++ * must display the following acknowledgement:
++ * This product includes software developed by the University of
++ * California, Berkeley and its contributors.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#if defined(LIBC_SCCS) && !defined(lint)
++static char sccsid[] = "@(#)strtouq.c 8.1 (Berkeley) 6/4/93";
++#endif /* LIBC_SCCS and not lint */
++#include <sys/cdefs.h>
++/*__FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoull.c,v 1.18 2002/09/06 11:23:59 tjr Exp $"); */
++
++#include <limits.h>
++#include <errno.h>
++#include <ctype.h>
++#include <stdlib.h>
++
++#if !defined(LLONG_MAX)
++#define LLONG_MAX 0x7fffffffffffffffLL
++#endif
++
++#if !defined(LLONG_MIN)
++#define LLONG_MIN -0x7fffffffffffffffLL-1
++#endif
++
++#if !defined(ULLONG_MAX)
++#define ULLONG_MAX 0xffffffffffffffffULL
++#endif
++
++/*
++ * Convert a string to an unsigned long long integer.
++ *
++ * Assumes that the upper and lower case
++ * alphabets and digits are each contiguous.
++ */
++unsigned long long
++pkgsrc_strtoull(const char * __restrict nptr, char ** __restrict endptr, int base)
++{
++ const char *s;
++ unsigned long long acc;
++ char c;
++ unsigned long long cutoff;
++ int neg, any, cutlim;
++
++ /*
++ * See strtoq for comments as to the logic used.
++ */
++ s = nptr;
++ do {
++ c = *s++;
++ } while (isspace((unsigned char)c));
++ if (c == '-') {
++ neg = 1;
++ c = *s++;
++ } else {
++ neg = 0;
++ if (c == '+')
++ c = *s++;
++ }
++ if ((base == 0 || base == 16) &&
++ c == '0' && (*s == 'x' || *s == 'X')) {
++ c = s[1];
++ s += 2;
++ base = 16;
++ }
++ if (base == 0)
++ base = c == '0' ? 8 : 10;
++ acc = any = 0;
++ if (base < 2 || base > 36)
++ goto noconv;
++
++ cutoff = ULLONG_MAX / base;
++ cutlim = ULLONG_MAX % base;
++ for ( ; ; c = *s++) {
++ if (c >= '0' && c <= '9')
++ c -= '0';
++ else if (c >= 'A' && c <= 'Z')
++ c -= 'A' - 10;
++ else if (c >= 'a' && c <= 'z')
++ c -= 'a' - 10;
++ else
++ break;
++ if (c >= base)
++ break;
++ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
++ any = -1;
++ else {
++ any = 1;
++ acc *= base;
++ acc += c;
++ }
++ }
++ if (any < 0) {
++ acc = ULLONG_MAX;
++ errno = ERANGE;
++ } else if (!any) {
++noconv:
++ errno = EINVAL;
++ } else if (neg)
++ acc = -acc;
++ if (endptr != NULL)
++ *endptr = (char *)(any ? s - 1 : nptr);
++ return (acc);
++}
diff --git a/databases/mysql55-client/patches/patch-vio_viosocket.c b/databases/mysql55-client/patches/patch-vio_viosocket.c
new file mode 100644
index 00000000000..4f92c686f46
--- /dev/null
+++ b/databases/mysql55-client/patches/patch-vio_viosocket.c
@@ -0,0 +1,55 @@
+$NetBSD: patch-vio_viosocket.c,v 1.1 2014/07/18 13:42:24 ryoon Exp $
+
+--- vio/viosocket.c.orig 2014-01-14 08:16:26.000000000 +0000
++++ vio/viosocket.c
+@@ -34,6 +34,12 @@
+ # include <sys/filio.h>
+ #endif
+
++#if defined(_SCO_DS)
++/* SCO OpenServer 5.0.7/3.2 has no SHUT_* macros.
++ See http://osr507doc.sco.com/en/netguide/disockD.system_calls.html */
++#define SHUT_RDWR 2
++#endif
++
+ int vio_errno(Vio *vio __attribute__((unused)))
+ {
+ return socket_errno; /* On Win32 this mapped to WSAGetLastError() */
+@@ -460,7 +466,12 @@ my_bool vio_get_normalized_ip_string(con
+ char *ip_string,
+ size_t ip_string_size)
+ {
++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage. */
++#if defined(_SCO_DS)
++ struct sockaddr_in norm_addr_storage;
++#else
+ struct sockaddr_storage norm_addr_storage;
++#endif
+ struct sockaddr *norm_addr= (struct sockaddr *) &norm_addr_storage;
+ int norm_addr_length;
+ int err_code;
+@@ -504,7 +515,11 @@ my_bool vio_peer_addr(Vio *vio, char *ip
+ */
+ struct in_addr *ip4= &((struct sockaddr_in *) &(vio->remote))->sin_addr;
+
++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage, and use sockaddr_in.
++ So there is no ss_family in sockaddr_in. */
++#if !defined(_SCO_DS)
+ vio->remote.ss_family= AF_INET;
++#endif
+ vio->addrLen= sizeof (struct sockaddr_in);
+
+ ip4->s_addr= htonl(INADDR_LOOPBACK);
+@@ -519,7 +534,12 @@ my_bool vio_peer_addr(Vio *vio, char *ip
+ int err_code;
+ char port_buffer[NI_MAXSERV];
+
++/* SCO OpenServer 5.0.7/3.2 has no sockaddr_storage. */
++#if defined(_SCO_DS)
++ struct sockaddr_in addr_storage;
++#else
+ struct sockaddr_storage addr_storage;
++#endif
+ struct sockaddr *addr= (struct sockaddr *) &addr_storage;
+ size_socket addr_length= sizeof (addr_storage);
+