summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authortsmith@ramayana.hindu.god <>2007-10-10 14:12:36 -0600
committertsmith@ramayana.hindu.god <>2007-10-10 14:12:36 -0600
commit070dc3ffb5f1b55cfe1fefcc98fbc853e9a2de2c (patch)
treef6768e14c6b33469e5461e1d148265be515118fe /mysys
parentced64f85823c7a9dcd6b9f952c136278567fa9f6 (diff)
parent82767a0a45dd2a8c356bd9a5c8e8971dd15d4b05 (diff)
downloadmariadb-git-070dc3ffb5f1b55cfe1fefcc98fbc853e9a2de2c.tar.gz
Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into ramayana.hindu.god:/home/tsmith/m/bk/maint/50
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_tempfile.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index c1108f85054..9460f27b104 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -59,12 +59,26 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
myf MyFlags __attribute__((unused)))
{
File file= -1;
+#ifdef __WIN__
+ TCHAR path_buf[MAX_PATH-14];
+#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(sizeof(path_buf), path_buf) > 0)
+ dir = path_buf;
+ }
+ /*
Use GetTempFileName to generate a unique filename, create
the file and release it's handle
- uses up to the first three letters from prefix