Below is the list of changes that have just been committed into a local
5.0 repository of stewart. When stewart does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1957 05/09/15 00:21:25 stewart@stripped +2 -0
BUG#13136 NdbTCP.cpp compile failure on OSX 10.2
use select if poll is unavailable.
ndb/src/common/portlib/win32/NdbTCP.c
1.4 05/09/15 00:21:21 stewart@stripped +1 -1
fix typo (found while fixing this bug)
ndb/src/common/portlib/NdbTCP.cpp
1.13 05/09/15 00:21:21 stewart@stripped +32 -0
Implement Ndb_check_socket_hup for systems without poll(2)
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: stewart
# Host: willster.(none)
# Root: /home/stewart/Documents/MySQL/5.0/bug13136
--- 1.3/ndb/src/common/portlib/win32/NdbTCP.c 2005-08-17 08:40:03 +10:00
+++ 1.4/ndb/src/common/portlib/win32/NdbTCP.c 2005-09-15 00:21:21 +10:00
@@ -52,7 +52,7 @@
FD_SET(sock, &writefds);
FD_SET(sock, &errorfds);
- if(select(1, &readfds, &writefds, &errorfds, &t)==SOCKET_ERROR)
+ if(select(1, &readfds, &writefds, &errorfds, &tv)==SOCKET_ERROR)
return 1;
if(FD_ISSET(sock,&errorfds))
--- 1.12/ndb/src/common/portlib/NdbTCP.cpp 2005-08-17 08:40:03 +10:00
+++ 1.13/ndb/src/common/portlib/NdbTCP.cpp 2005-09-15 00:21:21 +10:00
@@ -86,6 +86,7 @@
int Ndb_check_socket_hup(NDB_SOCKET_TYPE sock)
{
+#ifdef HAVE_POLL
struct pollfd pfd[1];
int r;
@@ -97,4 +98,35 @@
return 1;
return 0;
+#else /* HAVE_POLL */
+ fd_set readfds, writefds, errorfds;
+ struct timeval tv= {0,0};
+ int s_err;
+ int s_err_size= sizeof(s_err);
+
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&errorfds);
+
+ FD_SET(sock, &readfds);
+ FD_SET(sock, &writefds);
+ FD_SET(sock, &errorfds);
+
+ if(select(1, &readfds, &writefds, &errorfds, &tv)<0)
+ return 1;
+
+ if(FD_ISSET(sock,&errorfds))
+ return 1;
+
+ s_err=0;
+ if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (char*) &s_err, &s_err_size) != 0)
+ return(1);
+
+ if (s_err)
+ { /* getsockopt could succeed */
+ return(1); /* but return an error... */
+ }
+
+ return 0;
+#endif /* HAVE_POLL */
}
| Thread |
|---|
| • bk commit into 5.0 tree (stewart:1.1957) BUG#13136 | Stewart Smith | 14 Sep |