|
|||||||||||
|
bk commit into 5.0 tree (df:1.2531)
From: Daniel Fischer <df(at)mysql.com>
Date: Wed Sep 26 2007 - 14:46:04 EDT
ChangeSet@1.2531, 2007-09-26 20:45:59+02:00, df@pippilotta.erinye.com +1 -0 avoid using GetTempFileName in a way it's documented to not work on windows mysys/mf_tempfile.c@1.27, 2007-09-26 20:45:58+02:00, df@pippilotta.erinye.com +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
-- 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 26 14:57:51 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 09:40:40 EDT |
||||||||||
|
|||||||||||