diff options
author | unknown <joreland@mysql.com> | 2005-01-07 11:47:01 +0100 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2005-01-07 11:47:01 +0100 |
commit | b06480082c8085050eeb3750c56460895666a2b9 (patch) | |
tree | 1680d708e5f1d1b39b5725c96900bc979ca09a98 /ndb | |
parent | 51cae387a9a2c67b0f6249864714b8659c951670 (diff) | |
download | mariadb-git-b06480082c8085050eeb3750c56460895666a2b9.tar.gz |
bug#7690 - ndb startup with shm, use sigaction to escape SA_RESETHAND
configure.in:
Check for sigaction used in SHM_Transporter
ndb/src/common/transporter/SHM_Transporter.cpp:
remove unused variable
ndb/src/common/transporter/TransporterRegistry.cpp:
1) remove unused variable
2) Use sigaction instead of signal to install signal handler
This as signal uses SA_RESETHAND
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/src/common/transporter/SHM_Transporter.cpp | 2 | ||||
-rw-r--r-- | ndb/src/common/transporter/TransporterRegistry.cpp | 19 |
2 files changed, 16 insertions, 5 deletions
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 } |