diff options
author | monty@donna.mysql.com <> | 2000-12-18 16:09:19 +0200 |
---|---|---|
committer | monty@donna.mysql.com <> | 2000-12-18 16:09:19 +0200 |
commit | 155823ad5118be2fe50d9ef705bc5d627b7333b0 (patch) | |
tree | c93d85948282e07d8ce6727243cecb6a03d0335f /mysys/mf_tempfile.c | |
parent | 5cce198b6959a910925bf90c5abfb2275bff1891 (diff) | |
download | mariadb-git-155823ad5118be2fe50d9ef705bc5d627b7333b0.tar.gz |
Lots of new benchmark runs
Remember filename for temporary files created with mkstemp
Fixed wrongly allocated BDB share structure
Cleanups for SunPRO
Diffstat (limited to 'mysys/mf_tempfile.c')
-rw-r--r-- | mysys/mf_tempfile.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c index c9b60c87ef3..a12b4326705 100644 --- a/mysys/mf_tempfile.c +++ b/mysys/mf_tempfile.c @@ -88,6 +88,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, { char prefix_buff[30]; uint pfx_len; + File org_file; pfx_len=(strmov(strnmov(prefix_buff, prefix ? prefix : "tmp.", @@ -101,7 +102,16 @@ File create_temp_file(char *to, const char *dir, const char *prefix, } strmov(to,dir); strmov(convert_dirname(to),prefix_buff); - file=mkstemp(to); + org_file=mkstemp(to); + file=my_register_filename(org_file, to, FILE_BY_MKSTEMP, + EE_CANTCREATEFILE, MyFlags); + /* If we didn't manage to register the name, remove the temp file */ + if (org_file >= 0 && file < 0) + { + int tmp=my_errno; + (void) my_delete(to, MYF(MY_WME | ME_NOINPUT)); + my_errno=tmp; + } } #elif defined(HAVE_TEMPNAM) { |