summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2003-07-03 19:23:06 +0300
committermonty@narttu.mysql.fi <>2003-07-03 19:23:06 +0300
commitbe22700954f00691118f14e8755f573684167bc4 (patch)
tree763b9a64f7ae82fd4526acdc1cfff89969efca53 /libmysql
parent27f6a6c4d163d5932e5312fff5a351586f228175 (diff)
downloadmariadb-git-be22700954f00691118f14e8755f573684167bc4.tar.gz
Fix for UNIXWARE 7
Remove unaligned warnings on Ia64 from client library when using --host Fix for replication when using many file descriptors
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 3c8ac9f3387..aa169335dfb 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1596,6 +1596,18 @@ mysql_connect(MYSQL *mysql,const char *host,
/*
+ The following union is used to force a struct to be double allgined.
+ This is to avoid warings with gethostname_r() on Linux itanium systems
+*/
+
+typedef union
+{
+ double tmp;
+ char buff[GETHOSTBYNAME_BUFF_SIZE];
+} gethostbyname_buff;
+
+
+/*
Note that the mysql argument must be initialized with mysql_init()
before calling mysql_real_connect !
*/
@@ -1766,8 +1778,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
{
int tmp_errno;
struct hostent tmp_hostent,*hp;
- char buff2[GETHOSTBYNAME_BUFF_SIZE];
- hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2),
+ gethostbyname_buff buff2;
+ hp = my_gethostbyname_r(host,&tmp_hostent,buff2.buff,sizeof(buff2),
&tmp_errno);
if (!hp)
{