diff options
author | unknown <df@pippilotta.erinye.com> | 2007-09-27 09:42:54 +0200 |
---|---|---|
committer | unknown <df@pippilotta.erinye.com> | 2007-09-27 09:42:54 +0200 |
commit | bfa18c9a1159ae2f660dfc3004252115d392f36d (patch) | |
tree | 830c988d534b76d824a2ed66dd1f6eec2e9c2ff0 /mysys | |
parent | 9a640f848e465f2bebd27072fa651a230e9632f9 (diff) | |
parent | 5b770e3a984cfa03702dfb3e62876d4834bd9ded (diff) | |
download | mariadb-git-bfa18c9a1159ae2f660dfc3004252115d392f36d.tar.gz |
Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build-work-vista
into pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
mysys/mf_tempfile.c:
Auto merged
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_tempfile.c | 14 |
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 |