diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-09-02 09:12:18 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-09-02 09:12:18 -0300 |
commit | 66aa565d78c5af6f4ce2e4a689d946a32b614336 (patch) | |
tree | 9a0ed0877c40e5d2fc5bab5ce6e1b7ec2edaa1a1 /mysys | |
parent | 3668f8a5be32bc273d0ae29c85be3ab7ec5b3cd0 (diff) | |
parent | e512d6943447aae62c77b98bc75512387b991cdc (diff) | |
download | mariadb-git-66aa565d78c5af6f4ce2e4a689d946a32b614336.tar.gz |
Manual merge.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_iocache.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 41f7b1cae7d..1a47982b221 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -227,18 +227,21 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, for (;;) { size_t buffer_block; + /* + Unset MY_WAIT_IF_FULL bit if it is set, to prevent conflict with + MY_ZEROFILL. + */ + myf flags= (myf) (cache_myflags & ~(MY_WME | MY_WAIT_IF_FULL)); + if (cachesize < min_cache) cachesize = min_cache; buffer_block= cachesize; if (type == SEQ_READ_APPEND) buffer_block *= 2; - /* - Unset MY_WAIT_IF_FULL bit if it is set, to prevent conflict with - MY_ZEROFILL. - */ - myf flag = MYF((cache_myflags & ~ (MY_WME | MY_WAIT_IF_FULL)) | - (cachesize == min_cache ? MY_WME : 0)); - if ((info->buffer= (uchar*) my_malloc(buffer_block, flag)) != 0) + if (cachesize == min_cache) + flags|= (myf) MY_WME; + + if ((info->buffer= (uchar*) my_malloc(buffer_block, flags)) != 0) { info->write_buffer=info->buffer; if (type == SEQ_READ_APPEND) |