summaryrefslogtreecommitdiff
path: root/sql/mini_client.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-04-07 21:37:25 +0300
committerunknown <monty@mashka.mysql.fi>2003-04-07 21:37:25 +0300
commita312e13795d772af8edc3ba4a089e138b30e1b21 (patch)
tree24cd9d514c957dae27801d2bbc7c87d6cc939aa6 /sql/mini_client.cc
parent654d1026e4517c760372b828fe3c9457aa86972b (diff)
parentda68e3d69ff23aa89322bc4460a214aa57798c5b (diff)
downloadmariadb-git-a312e13795d772af8edc3ba4a089e138b30e1b21.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-3.23
into mashka.mysql.fi:/home/my/mysql-3.23 sql/slave.cc: Auto merged
Diffstat (limited to 'sql/mini_client.cc')
-rw-r--r--sql/mini_client.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index 453f27822d9..2c74eb96bf9 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -515,8 +515,6 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
host ? host : "(Null)",
db ? db : "(Null)",
user ? user : "(Null)"));
- thr_alarm_init(&alarmed);
- thr_alarm(&alarmed,(uint) net_read_timeout,&alarm_buff);
bzero((char*) &mysql->options,sizeof(mysql->options));
net->vio = 0; /* If something goes wrong */
@@ -598,7 +596,11 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
host=LOCAL_HOST;
sprintf(host_info=buff,ER(CR_TCP_CONNECTION),host);
DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host,port));
- if ((sock = socket(AF_INET,SOCK_STREAM,0)) == SOCKET_ERROR)
+ thr_alarm_init(&alarmed);
+ thr_alarm(&alarmed, net_read_timeout, &alarm_buff);
+ sock = (my_socket) socket(AF_INET,SOCK_STREAM,0);
+ thr_end_alarm(&alarmed);
+ if (sock == SOCKET_ERROR)
{
net->last_errno=CR_IPSOCK_ERROR;
sprintf(net->last_error,ER(net->last_errno),socket_errno);
@@ -641,12 +643,8 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
socket_errno,host));
net->last_errno= CR_CONN_HOST_ERROR;
sprintf(net->last_error ,ER(CR_CONN_HOST_ERROR), host, socket_errno);
- if (thr_alarm_in_use(&alarmed))
- thr_end_alarm(&alarmed);
goto error;
}
- if (thr_alarm_in_use(&alarmed))
- thr_end_alarm(&alarmed);
}
if (!net->vio || my_net_init(net, net->vio))