Commit c9640c59 authored by serg@serg.mylan's avatar serg@serg.mylan

uninitialized variable on Windows fixed

parent 4aa99ff7
...@@ -192,7 +192,7 @@ vio_should_retry(Vio * vio __attribute__((unused))) ...@@ -192,7 +192,7 @@ vio_should_retry(Vio * vio __attribute__((unused)))
int vio_close(Vio * vio) int vio_close(Vio * vio)
{ {
int r; int r=0;
DBUG_ENTER("vio_close"); DBUG_ENTER("vio_close");
#ifdef __WIN__ #ifdef __WIN__
if (vio->type == VIO_TYPE_NAMEDPIPE) if (vio->type == VIO_TYPE_NAMEDPIPE)
...@@ -206,7 +206,6 @@ int vio_close(Vio * vio) ...@@ -206,7 +206,6 @@ int vio_close(Vio * vio)
else if (vio->type != VIO_CLOSED) else if (vio->type != VIO_CLOSED)
#endif /* __WIN__ */ #endif /* __WIN__ */
{ {
r=0;
if (shutdown(vio->sd,2)) if (shutdown(vio->sd,2))
r= -1; r= -1;
if (closesocket(vio->sd)) if (closesocket(vio->sd))
...@@ -369,9 +368,9 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size) ...@@ -369,9 +368,9 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size)
remain_local = size; remain_local = size;
current_postion=buf; current_postion=buf;
do do
{ {
if (vio->shared_memory_remain == 0) if (vio->shared_memory_remain == 0)
{ {
if (WaitForSingleObject(vio->event_server_wrote,vio->net->read_timeout*1000) != WAIT_OBJECT_0) if (WaitForSingleObject(vio->event_server_wrote,vio->net->read_timeout*1000) != WAIT_OBJECT_0)
{ {
...@@ -384,9 +383,9 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size) ...@@ -384,9 +383,9 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size)
length = size; length = size;
if (vio->shared_memory_remain < length) if (vio->shared_memory_remain < length)
length = vio->shared_memory_remain; length = vio->shared_memory_remain;
if (length > remain_local) if (length > remain_local)
length = remain_local; length = remain_local;
memcpy(current_postion,vio->shared_memory_pos,length); memcpy(current_postion,vio->shared_memory_pos,length);
...@@ -396,7 +395,7 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size) ...@@ -396,7 +395,7 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size)
current_postion+=length; current_postion+=length;
remain_local-=length; remain_local-=length;
if (!vio->shared_memory_remain) if (!vio->shared_memory_remain)
if (!SetEvent(vio->event_client_read)) DBUG_RETURN(-1); if (!SetEvent(vio->event_client_read)) DBUG_RETURN(-1);
} while (remain_local); } while (remain_local);
length = size; length = size;
...@@ -419,11 +418,11 @@ int vio_write_shared_memory(Vio * vio, const gptr buf, int size) ...@@ -419,11 +418,11 @@ int vio_write_shared_memory(Vio * vio, const gptr buf, int size)
remain = size; remain = size;
current_postion = buf; current_postion = buf;
while (remain != 0) while (remain != 0)
{ {
if (WaitForSingleObject(vio->event_server_read,vio->net->write_timeout*1000) != WAIT_OBJECT_0) if (WaitForSingleObject(vio->event_server_read,vio->net->write_timeout*1000) != WAIT_OBJECT_0)
{ {
DBUG_RETURN(-1); DBUG_RETURN(-1);
}; };
sz = remain > shared_memory_buffer_length ? shared_memory_buffer_length: remain; sz = remain > shared_memory_buffer_length ? shared_memory_buffer_length: remain;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment