diff options
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/config/Defs.LINUX.x86.GCC.mk | 10 | ||||
-rw-r--r-- | ndb/include/portlib/NdbMutex.h | 1 | ||||
-rw-r--r-- | ndb/src/common/editline/unix.h | 3 | ||||
-rw-r--r-- | ndb/src/common/portlib/Makefile | 32 | ||||
-rw-r--r-- | ndb/src/common/portlib/memtest/memtest.c | 3 | ||||
-rw-r--r-- | ndb/src/common/portlib/unix/NdbTCP.c | 26 | ||||
-rw-r--r-- | ndb/src/common/portlib/unix/NdbThread.c | 2 | ||||
-rw-r--r-- | ndb/src/common/transporter/Makefile | 2 | ||||
-rw-r--r-- | ndb/src/common/transporter/SHM_Transporter.cpp | 4 | ||||
-rw-r--r-- | ndb/src/kernel/ndb-main/Main.cpp | 5 | ||||
-rw-r--r-- | ndb/src/mgmsrv/Makefile | 2 | ||||
-rw-r--r-- | ndb/src/mgmsrv/MgmtSrvr.cpp | 2 | ||||
-rw-r--r-- | ndb/src/ndbapi/Ndb.cpp | 3 | ||||
-rw-r--r-- | ndb/src/rep/Makefile | 2 |
14 files changed, 36 insertions, 61 deletions
diff --git a/ndb/config/Defs.LINUX.x86.GCC.mk b/ndb/config/Defs.LINUX.x86.GCC.mk index 698b0eb8350..6167a30ff23 100644 --- a/ndb/config/Defs.LINUX.x86.GCC.mk +++ b/ndb/config/Defs.LINUX.x86.GCC.mk @@ -6,9 +6,11 @@ SHELL := /bin/sh C++ := gcc$(GCC_VERSION) CC := gcc$(GCC_VERSION) AR_RCS := $(PURE) ar rcs -SO := gcc$(GCC_VERSION) -shared -lpthread -o +SO := gcc$(GCC_VERSION) -shared -lpthread -o +#SO := gcc$(GCC_VERSION) -shared -o MAKEDEPEND := gcc$(GCC_VERSION) -M +#MAKEDEPEND := gcc$(GCC_VERSION) -M -nostdinc -nostdinc++ PIC := -fPIC RPCGENFLAGS := -M -C -N @@ -27,7 +29,8 @@ else CCFLAGS_WARNINGS = -Wno-long-long -Wall endif # Add these for more warnings -Weffc++ -W -CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS +CCFLAGS_TOP = +#CCFLAGS_TOP = -DSAFE_MUTEX CCFLAGS_TOP += -fno-rtti -fno-exceptions ifeq (RELEASE, $(NDB_VERSION)) @@ -53,4 +56,5 @@ LINK.cc = $(PURE) $(CC) $(CCFLAGS) $(LDFLAGS) LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) -LDFLAGS_LAST = -lpthread -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp +LDFLAGS_LAST = -lrt -lpthread $(NDB_TOP)/src/common/portlib/gcc.cpp +#LDFLAGS_LAST = -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp $(NDB_TOP)/../mysys/libmysys.a $(NDB_TOP)/../dbug/libdbug.a $(NDB_TOP)/../regex/libregex.a $(NDB_TOP)/../strings/libmystrings.a -lpthread diff --git a/ndb/include/portlib/NdbMutex.h b/ndb/include/portlib/NdbMutex.h index 9ca2bae8ce1..52638b19c7e 100644 --- a/ndb/include/portlib/NdbMutex.h +++ b/ndb/include/portlib/NdbMutex.h @@ -22,7 +22,6 @@ #ifdef NDB_WIN32 #include <winsock2.h> #include <ws2tcpip.h> -#include <windows.h> #endif #ifdef __cplusplus diff --git a/ndb/src/common/editline/unix.h b/ndb/src/common/editline/unix.h index 582c4888856..37f461b471d 100644 --- a/ndb/src/common/editline/unix.h +++ b/ndb/src/common/editline/unix.h @@ -21,6 +21,5 @@ #define CRLF "\r\n" -#include <sys/types.h> -#include <sys/stat.h> +#include <ndb_global.h> #include <dirent.h> diff --git a/ndb/src/common/portlib/Makefile b/ndb/src/common/portlib/Makefile index a928fc1e6d7..48f4929a839 100644 --- a/ndb/src/common/portlib/Makefile +++ b/ndb/src/common/portlib/Makefile @@ -4,38 +4,16 @@ DIRS := ifeq ($(NDB_OS), SOFTOSE) DIRS += ose -endif - +else ifeq ($(NDB_OS), OSE) DIRS += ose -endif - -ifeq ($(NDB_OS), SIMCELLO) -DIRS += ose -endif - -ifeq ($(NDB_OS), LINUX) -DIRS += unix -endif - -ifeq ($(NDB_OS), MACOSX) -DIRS += unix -endif - -ifeq ($(NDB_OS), SOLARIS) +else +ifeq ($(NDB_OS), WIN32) +DIRS += win32 +else DIRS += unix endif - -ifeq ($(NDB_OS), SOLARIS6) -DIRS += unix endif - -ifeq ($(NDB_OS), HPUX) -DIRS += unix -endif - -ifeq ($(NDB_OS), WIN32) -DIRS += win32 endif diff --git a/ndb/src/common/portlib/memtest/memtest.c b/ndb/src/common/portlib/memtest/memtest.c index fb525c2f19f..059a4ec025e 100644 --- a/ndb/src/common/portlib/memtest/memtest.c +++ b/ndb/src/common/portlib/memtest/memtest.c @@ -17,8 +17,7 @@ #include <ndb_global.h> -#include <sys/time.h> -#include <sys/mman.h> + long long getMilli(); long long getMicro(); void malloctest(int loopcount, int memsize, int touch); diff --git a/ndb/src/common/portlib/unix/NdbTCP.c b/ndb/src/common/portlib/unix/NdbTCP.c index c2613c211c5..287dc6c2ecd 100644 --- a/ndb/src/common/portlib/unix/NdbTCP.c +++ b/ndb/src/common/portlib/unix/NdbTCP.c @@ -15,20 +15,26 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <NdbMutex.h> #include "NdbTCP.h" +#ifdef NDB_WIN32 +static NdbMutex & LOCK_gethostbyname = * NdbMutex_Create(); +#else +static NdbMutex LOCK_gethostbyname = NDB_MUTEX_INITIALIZER; +#endif -#ifdef NDB_SOLARIS int Ndb_getInAddr(struct in_addr * dst, const char *address) { - struct hostent host, * hostPtr; - char buf[1024]; - int h_errno; - hostPtr = gethostbyname_r(address, &host, &buf[0], 1024, &h_errno); + struct hostent * hostPtr; + NdbMutex_Lock(&LOCK_gethostbyname); + hostPtr = gethostbyname(address); if (hostPtr != NULL) { dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr; + NdbMutex_Unlock(&LOCK_gethostbyname); return 0; } + NdbMutex_Unlock(&LOCK_gethostbyname); /* Try it as aaa.bbb.ccc.ddd. */ dst->s_addr = inet_addr(address); @@ -37,13 +43,14 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { } return -1; } -#endif -#if defined NDB_LINUX || defined NDB_HPUX || defined NDB_MACOSX +#if 0 int Ndb_getInAddr(struct in_addr * dst, const char *address) { - struct hostent * hostPtr; - hostPtr = gethostbyname(address); + struct hostent host, * hostPtr; + char buf[1024]; + int h_errno; + hostPtr = gethostbyname_r(address, &host, &buf[0], 1024, &h_errno); if (hostPtr != NULL) { dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr; return 0; @@ -57,4 +64,3 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { return -1; } #endif - diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/unix/NdbThread.c index 7f043bef56e..a5c42f79be8 100644 --- a/ndb/src/common/portlib/unix/NdbThread.c +++ b/ndb/src/common/portlib/unix/NdbThread.c @@ -17,7 +17,7 @@ #include <ndb_global.h> #include <NdbThread.h> -#include <my_pthread.h> +#include <pthread.h> #define MAX_THREAD_NAME 16 diff --git a/ndb/src/common/transporter/Makefile b/ndb/src/common/transporter/Makefile index 5fb869e27eb..372bf640566 100644 --- a/ndb/src/common/transporter/Makefile +++ b/ndb/src/common/transporter/Makefile @@ -10,7 +10,6 @@ DIRS := basictest perftest SOURCES = \ Transporter.cpp \ SendBuffer.cpp \ - SHM_Transporter.cpp \ TCP_Transporter.cpp \ TransporterRegistry.cpp \ Packer.cpp @@ -22,6 +21,7 @@ CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \ ifeq ($(NDB_SHM), Y) +SOURCES += SHM_Transporter.cpp ifeq ($(NDB_OS), WIN32) SOURCES += SHM_Transporter.win32.cpp else diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index 525194db3a6..7c673f93c22 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -23,9 +23,7 @@ #include <NdbSleep.h> #include <NdbOut.hpp> -#ifdef NDB_WIN32 -#include <windows.h> -#else +#ifndef NDB_WIN32 #include <sys/ipc.h> #include <sys/shm.h> #endif diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp index f936c630d50..ef33802cab6 100644 --- a/ndb/src/kernel/ndb-main/Main.cpp +++ b/ndb/src/kernel/ndb-main/Main.cpp @@ -78,10 +78,6 @@ NDB_MAIN(ndb_kernel){ char homePath[255]; NdbConfig_HomePath(homePath, 255); -#if defined (NDB_LINUX) || defined (NDB_SOLARIS) - /** - * This has only been tested with linux & solaris - */ if (theConfig->getDaemonMode()) { // Become a daemon char lockfile[255], logfile[255]; @@ -134,7 +130,6 @@ NDB_MAIN(ndb_kernel){ } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); -#endif systemInfo(* theConfig, theConfig->clusterConfigurationData().SizeAltData.logLevel); diff --git a/ndb/src/mgmsrv/Makefile b/ndb/src/mgmsrv/Makefile index ebf50ecb76e..b10bdb64d30 100644 --- a/ndb/src/mgmsrv/Makefile +++ b/ndb/src/mgmsrv/Makefile @@ -6,8 +6,6 @@ BIN_TARGET := mgmtsrvr BIN_TARGET_LIBS := BIN_TARGET_ARCHIVES := mgmapi NDB_API mgmsrvcommon -LDFLAGS_LOC = -lpthread - ifneq ($(USE_EDITLINE), N) BIN_TARGET_ARCHIVES += editline DIRS := mkconfig diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 08bfe20aa95..7c2d94c6b7f 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <ndb_global.h> -#include <my_pthread.h> +#include <pthread.h> #include "MgmtSrvr.hpp" #include "MgmtErrorReporter.hpp" diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 68f49b975ee..448a29ca485 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -22,6 +22,7 @@ Name: Ndb.cpp ******************************************************************************/ #include <ndb_global.h> +#include <pthread.h> #include "NdbApiSignal.hpp" #include "NdbImpl.hpp" @@ -1244,7 +1245,7 @@ Ndb::printState(const char* fmt, ...) NdbMutex_Lock(&print_state_mutex); bool dups = false; ndbout << buf << " ndb=" << hex << this << dec; -#ifdef NDB_LINUX +#ifndef NDB_WIN32 ndbout << " thread=" << (int)pthread_self(); #endif ndbout << endl; diff --git a/ndb/src/rep/Makefile b/ndb/src/rep/Makefile index 29482b72687..9688a68ec74 100644 --- a/ndb/src/rep/Makefile +++ b/ndb/src/rep/Makefile @@ -12,8 +12,6 @@ BIN_TARGET := ndb_rep BIN_TARGET_LIBS := BIN_TARGET_ARCHIVES += editline repstorage repadapters reprequestor reptransfer mgmapi NDB_API mgmsrvcommon -LDFLAGS_LOC = -lpthread - SOURCES = \ RepMain.cpp \ Requestor.cpp \ |