List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:August 31 2010 11:46am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3739) Bug#56257
View as plain text  
#At file:///home/msvensson/mysql/7.0/ based on revid:jonas@stripped

 3739 Magnus Blåudd	2010-08-31
      Bug#56257 ndbd.exe refuses to start without absolute paths, "spawn_process" error
       - Always get the full path to the ndbd executable when angel spawns
        the ndbd.
       - Try with the given path if 'GetModuleFileName'  fails(very unlikely).

    modified:
      storage/ndb/src/kernel/angel.cpp
=== modified file 'storage/ndb/src/kernel/angel.cpp'
--- a/storage/ndb/src/kernel/angel.cpp	2010-08-20 08:35:41 +0000
+++ b/storage/ndb/src/kernel/angel.cpp	2010-08-31 11:46:48 +0000
@@ -319,6 +319,23 @@ extern int real_main(int, char**);
 static pid_t
 spawn_process(const char* progname, const BaseString& args)
 {
+#ifdef _WIN32
+  // Get full path name of this executeble
+  char path[MAX_PATH];
+  DWORD len = GetModuleFileName(NULL, path, sizeof(path));
+  if (len == 0 || len == sizeof(path))
+  {
+    g_eventLogger->warning("spawn_process: Could not extract full path, "
+                           "len: %u, error: %u\n",
+                           len, GetLastError());
+    // Fall through and try with progname as it was supplied
+  }
+  else
+  {
+    progname = path;
+  }
+#endif
+
   char** argv = BaseString::argify(progname, args.c_str());
   if (!argv)
   {

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20100831114648-iyvfmbf8z1uc78hp.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3739) Bug#56257Magnus Blåudd31 Aug