List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:June 1 2009 3:13pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:2938)
Bug#42704
View as plain text  
#At file:///home/msvensson/mysql/7.0/ based on revid:jonas@strippedinl7

 2938 Magnus Blåudd	2009-06-01
      Bug#42704 "Slave_IO_Running" differs in test result (2)
       - 'my_real_read' assumes that errno can be read also when no system function
         has failed. To avoid spurios errors "errno" must be rest to make sure that
         errno from previous affects the current read.
       - The reset of errno was removed in 7.0 with. It has as never been done on windows
         before but it should be done in the same way for any platform.

    modified:
      include/my_socket_posix.h
      include/my_socket_win32.h
      vio/viosocket.c
=== modified file 'include/my_socket_posix.h'
--- a/include/my_socket_posix.h	2009-04-22 13:12:37 +0000
+++ b/include/my_socket_posix.h	2009-06-01 15:13:46 +0000
@@ -47,6 +47,11 @@ static inline int my_socket_errno()
   return errno;
 }
 
+static inline void my_socket_set_errno(int error)
+{
+  errno= 0;
+}
+
 static inline my_socket my_socket_create(int domain, int type, int protocol)
 {
   my_socket s;

=== modified file 'include/my_socket_win32.h'
--- a/include/my_socket_win32.h	2009-04-22 13:12:37 +0000
+++ b/include/my_socket_win32.h	2009-06-01 15:13:46 +0000
@@ -42,6 +42,11 @@ static inline int my_socket_errno()
   return WSAGetLastError();
 }
 
+static inline void my_socket_set_errno(int error)
+{
+  WSASetLastError(error);
+}
+
 static inline my_socket my_socket_create(int domain, int type, int protocol)
 {
   my_socket s;

=== modified file 'vio/viosocket.c'
--- a/vio/viosocket.c	2009-05-27 15:21:45 +0000
+++ b/vio/viosocket.c	2009-06-01 15:13:46 +0000
@@ -42,6 +42,12 @@ size_t vio_read(Vio * vio, uchar* buf, s
   /* Ensure nobody uses vio_read_buff and vio_read simultaneously */
   DBUG_ASSERT(vio->read_end == vio->read_pos);
 
+  /*
+    Callers of 'vio_read' checks "errno" even if no system function
+    failed, to avoid false positives "errno" must be reset
+  */
+  my_socket_set_errno(0);
+
   r = my_recv(vio->sd, buf, size, 0);
 
 #ifndef DBUG_OFF

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20090601151346-9scmtzv2lzhueou4.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:2938)Bug#42704Magnus Blåudd1 Jun