summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2005-01-07 11:48:08 +0100
committerunknown <joreland@mysql.com>2005-01-07 11:48:08 +0100
commitf260ec737967c84b156054d3b8cdcb2022aadc3e (patch)
tree0f90f09173a1bf1c7211e681856a44ab15bc1c2c
parent888b665e6cb0cd8ee3b915c66c683afc4ece1963 (diff)
parentb06480082c8085050eeb3750c56460895666a2b9 (diff)
downloadmariadb-git-f260ec737967c84b156054d3b8cdcb2022aadc3e.tar.gz
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1
-rw-r--r--configure.in5
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.cpp2
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp19
3 files changed, 19 insertions, 7 deletions
diff --git a/configure.in b/configure.in
index 47447913168..f2184ed7be5 100644
--- a/configure.in
+++ b/configure.in
@@ -1924,7 +1924,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
realpath rename rint rwlock_init setupterm \
- shmget shmat shmdt shmctl \
+ shmget shmat shmdt shmctl sigaction \
sighold sigset sigthreadmask \
snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
@@ -3097,7 +3097,8 @@ ndb_transporter_opt_objs=""
if test "$ac_cv_func_shmget" = "yes" &&
test "$ac_cv_func_shmat" = "yes" &&
test "$ac_cv_func_shmdt" = "yes" &&
- test "$ac_cv_func_shmctl" = "yes"
+ test "$ac_cv_func_shmctl" = "yes" &&
+ test "$ac_cv_func_sigaction" = "yes"
then
AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
[Including Ndb Cluster DB shared memory transporter])
diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp
index ffb51bf1326..f0cbf822e53 100644
--- a/ndb/src/common/transporter/SHM_Transporter.cpp
+++ b/ndb/src/common/transporter/SHM_Transporter.cpp
@@ -26,8 +26,6 @@
#include <InputStream.hpp>
#include <OutputStream.hpp>
-extern int g_shm_pid;
-
SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg,
const char *lHostName,
const char *rHostName,
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index 2eb81b2b35d..c80e6bc1489 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -50,8 +50,6 @@
#include <EventLogger.hpp>
extern EventLogger g_eventLogger;
-int g_shm_pid = 0;
-
SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
{
DBUG_ENTER("SocketServer::Session * TransporterService::newSession");
@@ -1322,7 +1320,22 @@ TransporterRegistry::startReceiving()
#ifdef NDB_SHM_TRANSPORTER
m_shm_own_pid = getpid();
- signal(SIGUSR1, shm_sig_handler);
+ struct sigaction sa;
+ sa.sa_handler = shm_sig_handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ int ret;
+ while((ret = sigaction(SIGUSR1, &sa, 0)) == -1 && errno == EINTR);
+ if(ret != 0)
+ {
+ g_eventLogger.error("Failed to install signal handler for SHM transporter"
+ " errno: %d (%s)", errno,
+#ifdef HAVE_STRERROR
+ strerror(errno));
+#else
+ "");
+#endif
+ }
#endif
}