List:Commits« Previous MessageNext Message »
From:Daniel Fischer Date:September 26 2007 6:46pm
Subject:bk commit into 5.0 tree (df:1.2531)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of df. When df does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-09-26 20:45:59+02:00, df@stripped +1 -0
  avoid using GetTempFileName in a way it's documented to not work on windows

  mysys/mf_tempfile.c@stripped, 2007-09-26 20:45:58+02:00, df@stripped +14 -0
    Try to avoid passing null as first parameter to GetTempFileName, since it's documented that it won't work.

diff -Nrup a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
--- a/mysys/mf_tempfile.c	2007-03-23 11:01:46 +01:00
+++ b/mysys/mf_tempfile.c	2007-09-26 20:45:58 +02:00
@@ -59,11 +59,25 @@ File create_temp_file(char *to, const ch
 		      myf MyFlags __attribute__((unused)))
 {
   File file= -1;
+#ifdef __WIN__
+  TCHAR path_buf[256];
+#endif
 
   DBUG_ENTER("create_temp_file");
   DBUG_PRINT("enter", ("dir: %s, prefix: %s", dir, prefix));
 #if defined (__WIN__)
 
+   /*
+     Use GetTempPath to determine path for temporary files.
+     This is because the documentation for GetTempFileName 
+     has the following to say about this parameter:
+     "If this parameter is NULL, the function fails."
+   */
+   if (!dir)
+   {
+     if(GetTempPath(255, path_buf) > 0) 
+       dir = path_buf;
+   }
    /*
      Use GetTempFileName to generate a unique filename, create
      the file and release it's handle
Thread
bk commit into 5.0 tree (df:1.2531)Daniel Fischer26 Sep