diff options
author | unknown <tsmith@ramayana.hindu.god> | 2007-10-10 14:12:36 -0600 |
---|---|---|
committer | unknown <tsmith@ramayana.hindu.god> | 2007-10-10 14:12:36 -0600 |
commit | c7ca2283a97b3ff8df693b02cec682e24b86dc61 (patch) | |
tree | f6768e14c6b33469e5461e1d148265be515118fe /mysys | |
parent | 80ace294160241e48e211965ad412ad1d4806f73 (diff) | |
parent | f4b6234c489c4b8c3242828953b8ae71e5653c59 (diff) | |
download | mariadb-git-c7ca2283a97b3ff8df693b02cec682e24b86dc61.tar.gz |
Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into ramayana.hindu.god:/home/tsmith/m/bk/maint/50
mysql-test/mysql-test-run.pl:
Auto merged
scripts/mysql_system_tables_data.sql:
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 |