summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortulin@mysql.com <>2005-02-02 10:50:33 +0100
committertulin@mysql.com <>2005-02-02 10:50:33 +0100
commit653c6fa1adeecaf7136b6537eff8ae2e2d31d841 (patch)
tree8f0abbe9571ecc5712ac5c9432cde9ed72ae4c12
parent9ac631705adde8b36c796966bc9309c3216816b2 (diff)
downloadmariadb-git-653c6fa1adeecaf7136b6537eff8ae2e2d31d841.tar.gz
backported configure flag from 5.0
workaround for HPUX signal.h error, missing extern "C" moved my_thread_end to NdbThreadExit more checks for shared memory transporter signum setup
-rw-r--r--acinclude.m47
-rw-r--r--include/my_global.h6
-rw-r--r--ndb/src/common/portlib/NdbThread.c2
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.cpp14
4 files changed, 27 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 4f2ad8daf91..d7e22332655 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1624,7 +1624,12 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
--without-ndb-debug Disable special ndb debug features],
[ndb_debug="$withval"],
[ndb_debug="default"])
-
+ AC_ARG_WITH([ndb-ccflags],
+ [
+ --with-ndb-ccflags Extra CC options for ndb compile],
+ [ndb_cxxflags_fix="$ndb_cxxflags_fix $withval"],
+ [ndb_cxxflags_fix=$ndb_cxxflags_fix])
+
AC_MSG_CHECKING([for NDB Cluster options])
AC_MSG_RESULT([])
diff --git a/include/my_global.h b/include/my_global.h
index 3263d079853..7ca3d5e1e58 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -135,7 +135,13 @@
#ifdef HAVE_UNIXWARE7_THREADS
#include <thread.h>
#else
+#if defined(HPUX10) || defined(HPUX11)
+C_MODE_START /* HPUX needs this, signal.h bug */
+#include <pthread.h>
+C_MODE_END
+#else
#include <pthread.h> /* AIX must have this included first */
+#endif
#endif /* HAVE_UNIXWARE7_THREADS */
#endif /* HAVE_mit_thread */
#if !defined(SCO) && !defined(_REENTRANT)
diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c
index c1137efdb41..aaee9b45069 100644
--- a/ndb/src/common/portlib/NdbThread.c
+++ b/ndb/src/common/portlib/NdbThread.c
@@ -56,7 +56,6 @@ ndb_thread_wrapper(void* _ss){
void *ret;
struct NdbThread * ss = (struct NdbThread *)_ss;
ret= (* ss->func)(ss->object);
- my_thread_end();
NdbThread_Exit(ret);
}
/* will never be reached */
@@ -140,6 +139,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status)
void NdbThread_Exit(void *status)
{
+ my_thread_end();
pthread_exit(status);
}
diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp
index 9be4af1b9b5..07310e3a8b8 100644
--- a/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -3192,13 +3192,27 @@ fixShmKey(InitConfigFileParser::Context & ctx, const char *)
{
DBUG_ENTER("fixShmKey");
{
+ static int last_signum= -1;
Uint32 signum;
if(!ctx.m_currentSection->get("Signum", &signum))
{
signum= OPT_NDB_SHM_SIGNUM_DEFAULT;
+ if (signum <= 0)
+ {
+ ctx.reportError("Unable to set default parameter for [SHM]Signum"
+ " please specify [SHM DEFAULT]Signum");
+ return false;
+ }
ctx.m_currentSection->put("Signum", signum);
DBUG_PRINT("info",("Added Signum=%u", signum));
}
+ if ( last_signum != (int)signum && last_signum >= 0 )
+ {
+ ctx.reportError("All shared memory transporters must have same [SHM]Signum defined."
+ " Use [SHM DEFAULT]Signum");
+ return false;
+ }
+ last_signum= (int)signum;
}
{
Uint32 id1= 0, id2= 0, key= 0;