List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:September 22 2010 10:08am
Subject:bzr commit into mysql-5.1-telco-7.1 branch (magnus.blaudd:3818)
View as plain text  
#At file:///home/msvensson/mysql/tmp/8hbp29o8Wu/7.1/ based on revid:magnus.blaudd@strippedbglnfou

 3818 Magnus Blåudd	2010-09-22 [merge]
      Merge 7.0 -> 7.1

    modified:
      storage/ndb/include/portlib/NdbSleep.h
      storage/ndb/include/util/ndb_opts.h
      storage/ndb/src/common/util/ndb_opts.c
      storage/ndb/src/mgmapi/mgmapi.cpp
      storage/ndb/src/mgmapi/ndb_logevent.cpp
=== modified file 'storage/ndb/include/portlib/NdbSleep.h'
--- a/storage/ndb/include/portlib/NdbSleep.h	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/include/portlib/NdbSleep.h	2010-08-13 12:42:51 +0000
@@ -19,25 +19,27 @@
 #ifndef NDBSLEEP_H
 #define NDBSLEEP_H
 
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
 #include <ndb_global.h>
-#include <my_sys.h>
 
-static inline void NdbSleep_MilliSleep(int milliseconds)
+static inline
+void NdbSleep_MilliSleep(int milliseconds)
 {
-  my_sleep(ulong(milliseconds)*1000UL);
+#ifdef _WIN32
+  Sleep(milliseconds);
+#elif defined(HAVE_SELECT)
+  struct timeval t;
+  t.tv_sec =  milliseconds / 1000L;
+  t.tv_usec = (milliseconds % 1000L) * 1000L;
+  select(0,0,0,0,&t);
+#else
+#error No suitable function found to implement millisecond sleep.
+#endif
 }
-static inline void NdbSleep_SecSleep(int seconds)
+
+static inline
+void NdbSleep_SecSleep(int seconds)
 {
   NdbSleep_MilliSleep(seconds*1000);
 }
 
-#ifdef	__cplusplus
-}
-#endif
-
-
 #endif

=== modified file 'storage/ndb/include/util/ndb_opts.h'
--- a/storage/ndb/include/util/ndb_opts.h	2010-05-04 14:34:54 +0000
+++ b/storage/ndb/include/util/ndb_opts.h	2010-08-16 10:15:43 +0000
@@ -19,12 +19,14 @@
 #ifndef _NDB_OPTS_H
 #define _NDB_OPTS_H
 
+#include <ndb_global.h>
+
+#include <my_sys.h> /* loglevel needed by my_getopt.h */
+#include <my_getopt.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-#include <ndb_global.h>
-#include <my_sys.h>
-#include <my_getopt.h>
 
 #ifdef OPTEXPORT
 #define OPT_EXTERN(T,V,I) T V I

=== modified file 'storage/ndb/src/common/util/ndb_opts.c'
--- a/storage/ndb/src/common/util/ndb_opts.c	2010-05-05 09:30:08 +0000
+++ b/storage/ndb/src/common/util/ndb_opts.c	2010-08-16 10:15:43 +0000
@@ -1,8 +1,6 @@
-#include <my_global.h>
 #define OPTEXPORT
 #include <ndb_opts.h>
 
-#include <mysql_version.h>
 #include <ndb_version.h>
 
 static const char* g_ndb_opt_progname= "ndbapi_program";

=== modified file 'storage/ndb/src/mgmapi/mgmapi.cpp'
--- a/storage/ndb/src/mgmapi/mgmapi.cpp	2010-08-20 11:10:25 +0000
+++ b/storage/ndb/src/mgmapi/mgmapi.cpp	2010-09-22 10:07:28 +0000
@@ -17,10 +17,8 @@
 */
 
 #include <ndb_global.h>
-#include <my_sys.h>
 
 #include <LocalConfig.hpp>
-#include <NdbAutoPtr.hpp>
 
 #include <NdbSleep.h>
 #include <NdbTCP.h>
@@ -169,8 +167,10 @@ NdbMgmHandle
 ndb_mgm_create_handle()
 {
   DBUG_ENTER("ndb_mgm_create_handle");
-  NdbMgmHandle h     =
-    (NdbMgmHandle)my_malloc(sizeof(ndb_mgm_handle),MYF(MY_WME));
+  NdbMgmHandle h = (NdbMgmHandle)malloc(sizeof(ndb_mgm_handle));
+  if (!h)
+    return NULL;
+
   h->connected       = 0;
   h->last_error      = 0;
   h->last_error_line = 0;
@@ -178,7 +178,7 @@ ndb_mgm_create_handle()
   h->timeout         = 60000;
   h->cfg_i           = -1;
   h->errstream       = stdout;
-  h->m_name          = 0;
+  h->m_name          = NULL;
   h->m_bindaddress   = 0;
   h->m_bindaddress_port = 0;
   h->ignore_sigpipe  = true;
@@ -204,8 +204,8 @@ extern "C"
 void
 ndb_mgm_set_name(NdbMgmHandle handle, const char *name)
 {
-  my_free(handle->m_name, MYF(MY_ALLOW_ZERO_PTR));
-  handle->m_name= my_strdup(name, MYF(MY_WME));
+  free(handle->m_name);
+  handle->m_name= strdup(name);
 }
 
 extern "C"
@@ -237,8 +237,7 @@ int
 ndb_mgm_set_bindaddress(NdbMgmHandle handle, const char * arg)
 {
   DBUG_ENTER("ndb_mgm_set_bindaddress");
-  if (handle->m_bindaddress)
-    free(handle->m_bindaddress);
+  free(handle->m_bindaddress);
 
   if (arg)
   {
@@ -304,10 +303,9 @@ ndb_mgm_destroy_handle(NdbMgmHandle * ha
   }
 #endif
   (*handle)->cfg.~LocalConfig();
-  my_free((*handle)->m_name, MYF(MY_ALLOW_ZERO_PTR));
-  if ((*handle)->m_bindaddress)
-    free((*handle)->m_bindaddress);
-  my_free((char*)* handle,MYF(MY_ALLOW_ZERO_PTR));
+  free((*handle)->m_name);
+  free((*handle)->m_bindaddress);
+  free(*handle);
   * handle = 0;
   DBUG_VOID_RETURN;
 }
@@ -3358,7 +3356,7 @@ ndb_mgm_create_logevent_handle_same_sock
 static void
 free_log_handle(NdbLogEventHandle log_handle)
 {
-  my_free(log_handle, 0);
+  free(log_handle);
 }
 
 

=== modified file 'storage/ndb/src/mgmapi/ndb_logevent.cpp'
--- a/storage/ndb/src/mgmapi/ndb_logevent.cpp	2010-04-13 16:01:38 +0000
+++ b/storage/ndb/src/mgmapi/ndb_logevent.cpp	2010-08-13 13:04:47 +0000
@@ -17,7 +17,6 @@
 */
 
 #include <ndb_global.h>
-#include <my_sys.h>
 #include <mgmapi.h>
 #include <mgmapi_internal.h>
 
@@ -63,7 +62,9 @@ NdbLogEventHandle
 ndb_mgm_create_logevent_handle_same_socket(NdbMgmHandle mh)
 {
   NdbLogEventHandle h=
-    (NdbLogEventHandle)my_malloc(sizeof(ndb_logevent_handle),MYF(MY_WME));
+    (NdbLogEventHandle)malloc(sizeof(ndb_logevent_handle));
+  if (!h)
+    return NULL;
 
   h->socket= _ndb_mgm_get_socket(mh);
 
@@ -75,12 +76,17 @@ NdbLogEventHandle
 ndb_mgm_create_logevent_handle(NdbMgmHandle mh,
 			       const int filter[])
 {
+  NdbLogEventHandle h=
+    (NdbLogEventHandle)malloc(sizeof(ndb_logevent_handle));
+  if (!h)
+    return NULL;
+
   NDB_SOCKET_TYPE sock;
   if(ndb_mgm_listen_event_internal(mh, filter, 1, &sock) < 0)
+  {
+    free(h);
     return 0;
-
-  NdbLogEventHandle h=
-    (NdbLogEventHandle)my_malloc(sizeof(ndb_logevent_handle),MYF(MY_WME));
+  }
 
   h->socket= sock;
 
@@ -111,7 +117,7 @@ void ndb_mgm_destroy_logevent_handle(Ndb
   if ( *h )
     my_socket_close((*h)->socket);
 
-  my_free((char*)* h,MYF(MY_ALLOW_ZERO_PTR));
+  free(*h);
   * h = 0;
 }
 

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20100922100839-nk0irsy2vvlczg20.bundle
Thread
bzr commit into mysql-5.1-telco-7.1 branch (magnus.blaudd:3818) Magnus Blåudd22 Sep