summaryrefslogtreecommitdiff
path: root/mysys/mf_cache.c
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2000-11-15 23:00:06 +0200
committermonty@narttu.mysql.fi <>2000-11-15 23:00:06 +0200
commite69becf133867fff26b59ba74ec1ee722ce1e81e (patch)
tree622092bf596b26a1f762020729c03d573a5b216d /mysys/mf_cache.c
parent7a013339f84c48ea6194a35d9c00d0d549466b1d (diff)
downloadmariadb-git-e69becf133867fff26b59ba74ec1ee722ce1e81e.tar.gz
changed to use IO_CACHE instead of FILE
Diffstat (limited to 'mysys/mf_cache.c')
-rw-r--r--mysys/mf_cache.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mysys/mf_cache.c b/mysys/mf_cache.c
index 2c197f6fd20..ff29926ac50 100644
--- a/mysys/mf_cache.c
+++ b/mysys/mf_cache.c
@@ -74,7 +74,7 @@ my_bool open_cached_file(IO_CACHE *cache, const char* dir, const char *prefix,
}
my_free(cache->dir, MYF(MY_ALLOW_ZERO_PTR));
my_free(cache->prefix,MYF(MY_ALLOW_ZERO_PTR));
- DBUG_RETURN(0);
+ DBUG_RETURN(1);
}
/* Create the temporary file */
@@ -101,10 +101,12 @@ void close_cached_file(IO_CACHE *cache)
DBUG_ENTER("close_cached_file");
if (my_b_inited(cache))
{
+ File file=cache->file;
+ cache->file= -1; /* Don't flush data */
(void) end_io_cache(cache);
- if (cache->file >= 0)
+ if (file >= 0)
{
- (void) my_close(cache->file,MYF(0));
+ (void) my_close(file,MYF(0));
#ifdef CANT_DELETE_OPEN_FILES
if (cache->file_name)
{