|
|||||||||||
|
[patch 5/8] kernel on win32
From: <stewart(at)flamingspork.com>
Date: Wed Sep 19 2007 - 03:46:46 EDT ooo bzr diff -r1 -pa/:b/ ndb/src/kernel |di -X Make --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-08-29 07:25:53 +0000 +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-09-06 13:30:49 +0000 @@ -17,6 +17,11 @@ #include <ndb_global.h> #include <ndb_version.h> +#ifdef NDB_WIN32 +#include #include <NdbOut.hpp> #include <SchemaFile.hpp> @@ -203,8 +208,13 @@
const char * filename = argv[1];
argc--, argv++;
+#ifndef NDB_WIN32
struct stat sbuf;
const int res = stat(filename, &sbuf);
+#else
+ struct _stat sbuf;
+ const int res = _stat(filename, &sbuf); +#endif
if (res != 0) {
ndbout << filename << ": not found errno=" << errno << endl;
exitcode = 1;
--- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2007-08-29 07:25:53 +0000
+++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2007-09-06 13:30:50 +0000
@@ -14,6 +14,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define DBDIH_C +#include @@ -16,6 +16,11 @@ #include <ndb_global.h> +#ifdef NDB_WIN32 +#include #include <NdbOut.hpp> #include <Sysfile.hpp> @@ -125,8 +130,13 @@ for(int i = 1; i<argc; i++){
const char * filename = argv[i];
+#ifndef NDB_WIN32
struct stat sbuf;
const int res = stat(filename, &sbuf);
+#else
+ struct _stat sbuf;
+ const int res = _stat(filename, &sbuf); +#endif
if(res != 0){
ndbout << "Could not find file: \"" << filename << "\"" << endl;
continue;
--- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp 2007-08-29 07:25:53 +0000
+++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp 2007-09-06 13:30:50 +0000
@@ -510,6 +510,14 @@
}
+#ifdef NDB_WIN32 + int return_value; + if (SetFilePointer(hFile, maxOffset + maxSize, NULL, + FILE_BEGIN) == INVALID_SET_FILE_POINTER && + (return_value = GetLastError()) != NO_ERROR) + if (!SetEndOfFile(hFile)) + return GetLastError(); +#else
// Allocate a buffer and fill it with zeros
void* pbuf = ndbd_malloc(maxSize);
}
DEBUG(ndbout_c("extendfile: \"%s\" OK!", theFileName.c_str())); return 0;
@@ -262,10 +265,12 @@
char *logfile= NdbConfig_StdoutFileName(globalData.ownId);
NdbAutoPtr
#ifndef NDB_WIN32
if(type != NST_Normal && type != NST_Restart){
// Signal parent that error occured during startup
+#ifndef NDB_WIN32
if (type == NST_ErrorHandlerStartup)
kill(getppid(), SIGUSR1);
+#endif
g_eventLogger.info("Error handler shutdown completed - %s", exitAbort);
if (opt_core)
{
--- a/ndb/src/kernel/vm/SimulatedBlock.cpp 2007-08-29 07:25:53 +0000
+++ b/ndb/src/kernel/vm/SimulatedBlock.cpp 2007-09-06 13:30:50 +0000
@@ -855,7 +855,7 @@ SimulatedBlock::execSIGNAL_DROPPED_REP(Signal * signal){ char msg[64]; const SignalDroppedRep * const rep = (SignalDroppedRep *)&signal->theData[0]; - snprintf(msg, sizeof(msg), "%s GSN: %u (%u,%u)", getBlockName(number()), + BaseString::snprintf(msg, sizeof(msg), "%s GSN: %u (%u,%u)", getBlockName(number()), rep->originalGsn, rep->originalLength,rep->originalSectionCount); ErrorReporter::handleError(NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY, msg,
bool ok = true;
switch(secCount){
case TE_SIGNAL_LOST_SEND_BUFFER_FULL:
{
info ? " " : "", info ? info : ""); ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL, msg, __FILE__, NST_ErrorHandler); @@ -351,7 +352,7 @@
case TE_SIGNAL_LOST:
info ? " " : "", info ? info : "");
ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST,
msg, __FILE__, NST_ErrorHandler);
@@ -359,7 +360,7 @@
case TE_SHM_IPC_PERMANENT:
"Remote node id %d.%s%s",
nodeId, info ? " " : "", info ? info : "");
ErrorReporter::handleError(NDBD_EXIT_CONNECTION_SETUP_FAILED,
--- a/ndb/src/kernel/vm/WatchDog.cpp 2007-08-29 07:25:53 +0000
+++ b/ndb/src/kernel/vm/WatchDog.cpp 2007-09-06 13:30:50 +0000
@@ -16,7 +16,9 @@ #include
#include "WatchDog.hpp"
break;
}//switch
g_eventLogger.warning("Ndb kernel is stuck in: %s", last_stuck_action);
+#ifndef NDB_WIN32
{
struct tms my_tms;
times(&my_tms);
-- Stewart Smith -- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Wed Sep 19 04:18:40 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 09:33:02 EDT |
||||||||||
|
|||||||||||