diff options
Diffstat (limited to 'mysys/mf_iocache.c')
-rw-r--r-- | mysys/mf_iocache.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index cd2a140182e..eb8b992c601 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -333,7 +333,11 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, { info->read_end=info->write_pos; info->end_of_file=my_b_tell(info); - info->seek_not_done=1; + /* + Trigger a new seek only if we have a valid + file handle. + */ + info->seek_not_done= (info->file != -1); } else if (type == WRITE_CACHE) { |