List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:March 12 2008 6:06am
Subject:bk commit into 5.0 tree (stewart:1.2535)
View as plain text  
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@stripped, 2008-03-12 17:06:33+11:00, stewart@willster.(none) +9 -0
  WL4012 ndb_mgmd on win32: fix various things with latest patches to get ndb_mgmd to build
  
  (works on VS2008 too!)

  include/my_pthread.h@stripped, 2008-03-12 17:06:30+11:00, stewart@willster.(none) +12 -2
    Better define some pthread_mutex functions as inline instead of macros to get nice type checking and obvious return values (and some vague idea of posix compliance)

  ndb/include/portlib/NdbTCP.h@stripped, 2008-03-12 17:06:30+11:00, stewart@willster.(none) +1 -1
    correct type for socket parameter to setsocknonblock

  ndb/src/CMakeLists.txt@stripped, 2008-03-12 17:06:30+11:00, stewart@willster.(none) +1 -0
    add win32 portlib library to ndbclient

  ndb/src/common/portlib/CMakeLists.txt@stripped, 2008-03-12 17:06:30+11:00, stewart@willster.(none) +7 -10
    use win32 NdbTick, add win32/ as a subdirectory

  ndb/src/common/portlib/NdbTCP.cpp@stripped, 2008-03-12 17:06:31+11:00, stewart@willster.(none) +5 -1
    remove reference to file that doesn't exist.

  ndb/src/common/portlib/win32/CMakeLists.txt@stripped, 2008-03-12 17:06:31+11:00, stewart@willster.(none) +26 -0
    New BitKeeper file ``ndb/src/common/portlib/win32/CMakeLists.txt''
    
    Build win32 specific portlib files.

  ndb/src/common/portlib/win32/CMakeLists.txt@stripped, 2008-03-12 17:06:31+11:00, stewart@willster.(none) +0 -0

  ndb/src/mgmsrv/CMakeLists.txt@stripped, 2008-03-12 17:06:31+11:00, stewart@willster.(none) +2 -0
    build ndbmgmclient with ndbportlib and win32 portlib

  ndb/src/mgmsrv/MgmtSrvr.cpp@stripped, 2008-03-12 17:06:31+11:00, stewart@willster.(none) +1 -1
    use portable snprintf

  ndb/src/mgmsrv/main.cpp@stripped, 2008-03-12 17:06:31+11:00, stewart@willster.(none) +4 -2
    use portable my_stat instead of stat.

diff -Nrup a/include/my_pthread.h b/include/my_pthread.h
--- a/include/my_pthread.h	2007-12-14 18:03:42 +11:00
+++ b/include/my_pthread.h	2008-03-12 17:06:30 +11:00
@@ -179,8 +179,18 @@ extern int pthread_mutex_destroy (pthrea
 #define pthread_mutex_init(A,B)  (InitializeCriticalSection(A),0)
 #define pthread_mutex_lock(A)	 (EnterCriticalSection(A),0)
 #define pthread_mutex_trylock(A) (WaitForSingleObject((A), 0) == WAIT_TIMEOUT)
-#define pthread_mutex_unlock(A)  LeaveCriticalSection(A)
-#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
+
+static inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
+{
+  LeaveCriticalSection(mutex);
+  return 0;
+}
+
+static inline int pthread_mutex_destroy(pthread_mutex_t *mutex)
+{
+  DeleteCriticalSection(mutex);
+  return 0;
+}
 #define my_pthread_setprio(A,B)  SetThreadPriority(GetCurrentThread(), (B))
 #define pthread_kill(A,B) pthread_dummy(ESRCH)
 #endif /* OS2 */
diff -Nrup a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h
--- a/ndb/include/portlib/NdbTCP.h	2008-01-30 15:01:19 +11:00
+++ b/ndb/include/portlib/NdbTCP.h	2008-03-12 17:06:30 +11:00
@@ -90,7 +90,7 @@ int NDB_CLOSE_SOCKET(int fd);
 
 int Ndb_check_socket_hup(NDB_SOCKET_TYPE sock);
 
-int setsocknonblock(int socket);
+int setsocknonblock(NDB_SOCKET_TYPE socket);
 #ifdef NDB_WIN
 #define NONBLOCKERR(E) (E!=SOCKET_EAGAIN && E!=SOCKET_EWOULDBLOCK)
 #else
diff -Nrup a/ndb/src/CMakeLists.txt b/ndb/src/CMakeLists.txt
--- a/ndb/src/CMakeLists.txt	2007-12-13 23:56:04 +11:00
+++ b/ndb/src/CMakeLists.txt	2008-03-12 17:06:30 +11:00
@@ -40,6 +40,7 @@ ADD_CUSTOM_COMMAND(TARGET ndbclient
                    "${CMAKE_CURRENT_BINARY_DIR}/common/mgmcommon/${CMAKE_CFG_INTDIR}/ndbmgmsrv.lib"
                    "${CMAKE_CURRENT_BINARY_DIR}/common/logger/${CMAKE_CFG_INTDIR}/ndblogger.lib"
                    "${CMAKE_CURRENT_BINARY_DIR}/common/portlib/${CMAKE_CFG_INTDIR}/ndbportlib.lib"
+                   "${CMAKE_CURRENT_BINARY_DIR}/common/portlib/win32/${CMAKE_CFG_INTDIR}/ndbwin32portlib.lib"
                    "${CMAKE_CURRENT_BINARY_DIR}/common/util/${CMAKE_CFG_INTDIR}/ndbgeneral.lib")
 ADD_DEPENDENCIES(ndbclient
                  ndbapi
diff -Nrup a/ndb/src/common/portlib/CMakeLists.txt b/ndb/src/common/portlib/CMakeLists.txt
--- a/ndb/src/common/portlib/CMakeLists.txt	2008-01-30 15:01:32 +11:00
+++ b/ndb/src/common/portlib/CMakeLists.txt	2008-03-12 17:06:30 +11:00
@@ -13,6 +13,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+ADD_SUBDIRECTORY(win32)
 
 INCLUDE(${CMAKE_BINARY_DIR}/ndb/config/type_util.cmake)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql
@@ -20,17 +21,13 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/
                    )
 
 ADD_LIBRARY(ndbportlib STATIC
-            NdbCondition.c NdbMutex.c NdbTick.c winNdbTick.c
+            NdbCondition.c NdbMutex.c
             NdbEnv.c NdbThread.c NdbHost.c NdbTCP.cpp
-            NdbDaemonOld.c NdbDaemon.cpp win32/NdbDaemon.cpp
-            NdbMem.c NdbConfig.c
-            ${CMAKE_SOURCE_DIR}/sql/nt_servc.cc
-            )
-
-#            win32/NdbCondition.c win32/NdbDaemon.c win32/NdbEnv.c
-#            win32/NdbHost.c win32/NdbMem.c  win32/NdbMutex.c
-#            win32/NdbSleep.c win32/NdbTCP.c win32/NdbThread.c
-#            )
+            NdbDaemonOld.c NdbDaemon.cpp
+            NdbMem.c NdbConfig.c)
+IF(WIN32)
+LINK_LIBRARIES(ndbportlib ndbwin32portlib)
+ENDIF(WIN32)
 
 #ADD_EXECUTABLE(memtest memtest.c)
 #TARGET_LINK_LIBRARIES(memtest ndbportlib wsock32)
diff -Nrup a/ndb/src/common/portlib/NdbTCP.cpp b/ndb/src/common/portlib/NdbTCP.cpp
--- a/ndb/src/common/portlib/NdbTCP.cpp	2008-01-30 15:01:19 +11:00
+++ b/ndb/src/common/portlib/NdbTCP.cpp	2008-03-12 17:06:31 +11:00
@@ -53,6 +53,7 @@ Ndb_getInAddr(struct in_addr * dst, cons
   //		      address, errno, strerror(errno)));
   return -1; //DBUG_RETURN(-1);
 }
+
 extern "C"
 #ifndef NDB_WIN
 int setsocknonblock(int s)
@@ -61,7 +62,10 @@ int setsocknonblock(int s)
   return fcntl(s, F_SETFL, _fs | O_NONBLOCK);
 }
 #else
-#include "win32/NdbTCP.cpp"
+int setsocknonblock(NDB_SOCKET_TYPE s)
+{
+  return ioctlsocket(s, FIONBIO, (u_long *)1);
+}
 #endif
 
 #ifndef DBUG_OFF
diff -Nrup a/ndb/src/common/portlib/win32/CMakeLists.txt b/ndb/src/common/portlib/win32/CMakeLists.txt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/ndb/src/common/portlib/win32/CMakeLists.txt	2008-03-12 17:06:31 +11:00
@@ -0,0 +1,26 @@
+# Copyright (C) 2007 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+INCLUDE(${CMAKE_BINARY_DIR}/ndb/config/type_util.cmake)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql
+                    ${CMAKE_SOURCE_DIR}/ndb/include/ndbapi
+                   )
+
+ADD_LIBRARY(ndbwin32portlib STATIC
+            NdbTick.c
+            NdbDaemon.cpp
+            ${CMAKE_SOURCE_DIR}/sql/nt_servc.cc
+            )
+
diff -Nrup a/ndb/src/mgmsrv/CMakeLists.txt b/ndb/src/mgmsrv/CMakeLists.txt
--- a/ndb/src/mgmsrv/CMakeLists.txt	2007-12-13 23:56:06 +11:00
+++ b/ndb/src/mgmsrv/CMakeLists.txt	2008-03-12 17:06:31 +11:00
@@ -28,6 +28,8 @@ LINK_LIBRARIES(ndbmgmclient
                mysys
                strings
                ndbgeneral
+               ndbportlib
+               ndbwin32portlib
                ${NDB_SCI_LIBS})
 IF(WIN32)
 LINK_LIBRARIES(wsock32)
diff -Nrup a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp	2008-02-11 16:23:38 +11:00
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp	2008-03-12 17:06:31 +11:00
@@ -2890,7 +2890,7 @@ int MgmtSrvr::connect_to_self(void)
 {
   int r= 0;
   m_local_mgm_handle= ndb_mgm_create_handle();
-  snprintf(m_local_mgm_connect_string,sizeof(m_local_mgm_connect_string),
+  BaseString::snprintf(m_local_mgm_connect_string,sizeof(m_local_mgm_connect_string),
            "localhost:%u",getPort());
   ndb_mgm_set_connectstring(m_local_mgm_handle, m_local_mgm_connect_string);
 
diff -Nrup a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp
--- a/ndb/src/mgmsrv/main.cpp	2008-02-11 16:47:09 +11:00
+++ b/ndb/src/mgmsrv/main.cpp	2008-03-12 17:06:31 +11:00
@@ -36,6 +36,8 @@
 
 #include <NdbAutoPtr.hpp>
 
+#include <my_dir.h>
+
 #if defined NDB_OSE || defined NDB_SOFTOSE
 #include <efs.h>
 #else
@@ -226,8 +228,8 @@ start:
 
   if (opt_mycnf == 0 && opt_config_filename == 0)
   {
-    struct stat buf;
-    if (stat("config.ini", &buf) != -1)
+    MY_STAT buf;
+    if (my_stat("config.ini", &buf, MYF(0)) != NULL)
       opt_config_filename = "config.ini";
   }
   
Thread
bk commit into 5.0 tree (stewart:1.2535)Stewart Smith12 Mar