diff --git a/ndb/Defs.mk b/ndb/Defs.mk index 8ac9e28b721..cf891caa5c2 100644 --- a/ndb/Defs.mk +++ b/ndb/Defs.mk @@ -53,7 +53,11 @@ SHLIBEXT := so endif ifeq ($(NDB_SCI), Y) -CCFLAGS_TOP += -DHAVE_SCI +CCFLAGS_TOP += -DHAVE_NDB_SCI +endif + +ifeq ($(NDB_SHM), Y) +CCFLAGS_TOP += -DHAVE_NDB_SHM endif ifneq ($(findstring OSE, $(NDB_OS)),) diff --git a/ndb/config/GuessConfig.sh b/ndb/config/GuessConfig.sh index d2d8446c704..3caeeaae6d0 100755 --- a/ndb/config/GuessConfig.sh +++ b/ndb/config/GuessConfig.sh @@ -11,6 +11,11 @@ then NDB_SCI=N fi +if [ -z "$NDB_SHM" ] +then + NDB_SHM=N +fi + os=`uname -s` case $os in Linux) diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index d79ffc07566..5e03b972268 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -3,6 +3,13 @@ #define NDBGLOBAL_H #include + +#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) +#define NDB_WIN32 +#else +#undef NDB_WIN32 +#endif + #include #include #include @@ -31,7 +38,6 @@ #ifdef NDB_WIN32 #include #include -#include #define DIR_SEPARATOR "\\" #define PATH_MAX 256 diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 04a52c7d033..42c34855c39 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -40,24 +40,8 @@ typedef int socklen_t; #define InetErrno (* inet_errno()) -#endif +#elif NDB_WIN32 -#if defined NDB_SOLARIS || defined NDB_HPUX || defined NDB_IBMAIX || defined NDB_TRU64X || NDB_LINUX || defined NDB_MACOSX -/** - * Include files needed - */ -#include - -#define NDB_NONBLOCK O_NONBLOCK -#define NDB_SOCKET_TYPE int -#define NDB_INVALID_SOCKET -1 -#define NDB_CLOSE_SOCKET(x) close(x) - -#define InetErrno errno - -#endif - -#ifdef NDB_WIN32 /** * Include files needed */ @@ -70,6 +54,20 @@ typedef int socklen_t; #define NDB_INVALID_SOCKET INVALID_SOCKET #define NDB_CLOSE_SOCKET(x) closesocket(x) +#else + +/** + * Include files needed + */ +#include + +#define NDB_NONBLOCK O_NONBLOCK +#define NDB_SOCKET_TYPE int +#define NDB_INVALID_SOCKET -1 +#define NDB_CLOSE_SOCKET(x) close(x) + +#define InetErrno errno + #endif #define NDB_SOCKLEN_T SOCKET_SIZE_TYPE diff --git a/ndb/src/common/transporter/Makefile b/ndb/src/common/transporter/Makefile index 3bd23b627d3..5fb869e27eb 100644 --- a/ndb/src/common/transporter/Makefile +++ b/ndb/src/common/transporter/Makefile @@ -20,37 +20,18 @@ DIRS := basictest perftest CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \ -I$(call fixpath,$(NDB_TOP)/include/transporter) + +ifeq ($(NDB_SHM), Y) ifeq ($(NDB_OS), WIN32) SOURCES += SHM_Transporter.win32.cpp -endif - -ifeq ($(NDB_OS), SOLARIS) +else SOURCES += SHM_Transporter.unix.cpp endif - -ifeq ($(NDB_OS), HPUX) -SOURCES += SHM_Transporter.unix.cpp endif -ifeq ($(NDB_OS), MACOSX) -SOURCES += SHM_Transporter.unix.cpp -endif - -ifeq ($(NDB_OS), IBMAIX) -SOURCES += SHM_Transporter.unix.cpp -endif - -ifeq ($(NDB_OS), TRU64X) -SOURCES += SHM_Transporter.unix.cpp -endif - -ifeq ($(NDB_OS), LINUX) -SOURCES += SHM_Transporter.unix.cpp ifeq ($(NDB_SCI), Y) SOURCES += SCI_Transporter.cpp endif -endif - ifneq ($(findstring OSE, $(NDB_OS)),) SOURCES += OSE_Transporter.cpp diff --git a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp index 18d54ca1e89..624b495422f 100644 --- a/ndb/src/common/transporter/TransporterInternalDefinitions.hpp +++ b/ndb/src/common/transporter/TransporterInternalDefinitions.hpp @@ -21,39 +21,18 @@ #include #endif -#ifdef NDB_SOLARIS #define NDB_TCP_TRANSPORTER -//#define NDB_SCI_TRANSPORTER + +#ifdef HAVE_NDB_SHM #define NDB_SHM_TRANSPORTER -#elif defined NDB_OSE || defined NDB_SOFTOSE -#define NDB_TCP_TRANSPORTER -#define NDB_OSE_TRANSPORTER -#elif defined NDB_LINUX -#define NDB_TCP_TRANSPORTER -#define NDB_SCI_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_WIN32 -#define NDB_TCP_TRANSPORTER -#elif defined NDB_HPUX -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_MACOSX -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_IBMAIX -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#elif defined NDB_TRU64X -#define NDB_TCP_TRANSPORTER -#define NDB_SHM_TRANSPORTER -#else -#error unsupported platform #endif -#ifndef HAVE_SCI -#ifdef NDB_SCI_TRANSPORTER -#undef NDB_SCI_TRANSPORTER +#ifdef HAVE_NDB_SCI +#define NDB_SCI_TRANSPORTER #endif + +#ifdef HAVE_NDB_OSE +#define NDB_OSE_TRANSPORTER #endif #ifdef DEBUG_TRANSPORTER diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 9c1cf5021b3..36322ffad1e 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -854,7 +854,7 @@ int Ndbfs::translateErrno(int aErrno) //no space left on device case ENFILE: case EDQUOT: -#ifndef NDB_MACOSX +#ifdef ENOSR case ENOSR: #endif case ENOSPC: @@ -872,12 +872,16 @@ int Ndbfs::translateErrno(int aErrno) return FsRef::fsErrInvalidParameters; //environment error case ELOOP: -#ifndef NDB_MACOSX +#ifdef ENOLINK case ENOLINK: +#endif +#ifdef EMULTIHOP case EMULTIHOP: #endif -#ifndef NDB_LINUX +#ifdef EOPNOTSUPP case EOPNOTSUPP: +#endif +#ifdef ESPIPE case ESPIPE: #endif case EPIPE: diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp index 1619ee417f5..f936c630d50 100644 --- a/ndb/src/kernel/ndb-main/Main.cpp +++ b/ndb/src/kernel/ndb-main/Main.cpp @@ -257,8 +257,10 @@ handler(int sig){ case SIGINT: /* 2 - Interrupt */ case SIGQUIT: /* 3 - Quit */ case SIGTERM: /* 15 - Terminate */ -#ifndef NDB_MACOSX +#ifdef SIGPWR case SIGPWR: /* 19 - Power fail */ +#endif +#ifdef SIGPOLL case SIGPOLL: /* 22 */ #endif case SIGSTOP: /* 23 */ diff --git a/ndb/test/src/HugoAsynchTransactions.cpp b/ndb/test/src/HugoAsynchTransactions.cpp index d045032d455..2af22b5f48d 100644 --- a/ndb/test/src/HugoAsynchTransactions.cpp +++ b/ndb/test/src/HugoAsynchTransactions.cpp @@ -473,6 +473,10 @@ HugoAsynchTransactions::executeAsynchOperation(Ndb* pNdb, } } break; + case NO_INSERT: + case NO_UPDATE: + case NO_DELETE: + abort(); } // Close all transactions