summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tim@cane.mysql.fi>2000-12-21 11:54:08 +0200
committerunknown <tim@cane.mysql.fi>2000-12-21 11:54:08 +0200
commit33cc250f670574c05d5933049ed1f9c7e4b168fb (patch)
tree8289f700fb9c3073f20ac23cce22265f83601c39
parent27336dfe8fbd4e12b06e99778de5d8c1c7e837f0 (diff)
downloadmariadb-git-33cc250f670574c05d5933049ed1f9c7e4b168fb.tar.gz
Compatibility fix for BSDi.
BSDi uses size_t * for the optlen arg to getsockopt, while other Unixes use socklen_t *. acconfig.h: - compatibility fix for BSDi (getsockopt optlen type) configure.in: - compatibility fix for BSDi (getsockopt optlen type) libmysql/libmysql.c: - compatibility fix for BSDi (getsockopt optlen type) sql/mini_client.cc: - compatibility fix for BSDi (getsockopt optlen type)
-rw-r--r--acconfig.h3
-rw-r--r--configure.in5
-rw-r--r--libmysql/libmysql.c2
-rw-r--r--sql/mini_client.cc2
4 files changed, 10 insertions, 2 deletions
diff --git a/acconfig.h b/acconfig.h
index e1373fa17f0..3b9874b2e6a 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -186,6 +186,9 @@
/* Define as the base type of the last arg to accept */
#undef SOCKET_SIZE_TYPE
+/* Last argument to get/setsockopt */
+#undef SOCKOPT_OPTLEN_TYPE
+
#undef SPEED_T_IN_SYS_TYPES
#undef SPRINTF_RETURNS_PTR
#undef SPRINTF_RETURNS_INT
diff --git a/configure.in b/configure.in
index cfd8e8e20f6..3ad2ef4b860 100644
--- a/configure.in
+++ b/configure.in
@@ -1175,6 +1175,11 @@ AC_C_BIGENDIAN
#---START: Used in for client configure
# Check base type of last arg to accept
MYSQL_TYPE_ACCEPT
+case "$SYSTEM_TYPE" in
+*bsdi* ) AC_DEFINE_UNQUOTED(SOCKOPT_OPTLEN_TYPE, size_t);;
+* ) AC_DEFINE_UNQUOTED(SOCKOPT_OPTLEN_TYPE, size_socket);;
+esac
+
#---END:
# Find where the stack goes
MYSQL_STACK_DIRECTION
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 9f71273b119..979ef6a4945 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -125,7 +125,7 @@ static int connect2(my_socket s, const struct sockaddr *name, uint namelen,
return connect(s, (struct sockaddr*) name, namelen);
#else
int flags, res, s_err;
- size_socket s_err_size = sizeof(uint);
+ SOCKOPT_OPTLEN_TYPE s_err_size = sizeof(uint);
fd_set sfds;
struct timeval tv;
time_t start_time, now_time;
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index 11b0b111ec4..12c8a740398 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -233,7 +233,7 @@ static int mc_sock_connect(my_socket s, const struct sockaddr *name,
return connect(s, (struct sockaddr*) name, namelen);
#else
int flags, res, s_err;
- size_socket s_err_size = sizeof(uint);
+ SOCKOPT_OPTLEN_TYPE s_err_size = sizeof(uint);
fd_set sfds;
struct timeval tv;