summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorkostja@bodhi.local <>2007-03-06 16:44:14 +0300
committerkostja@bodhi.local <>2007-03-06 16:44:14 +0300
commit3d488d496d66a310de0849ca55be4a6d6ddb7c09 (patch)
tree5ab59b0392a68db1b929fa51dcc17626e375132e /mysys
parentcba58e5910de1c31ccc0f99210688a4ef3228a8f (diff)
parentd445d5e4ccdeeb775e8db97ed46493d65b54cc5f (diff)
downloadmariadb-git-3d488d496d66a310de0849ca55be4a6d6ddb7c09.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_iocache2.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index b3ae18e9932..bdb5d057a16 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -50,7 +50,6 @@
int
my_b_copy_to_file(IO_CACHE *cache, FILE *file)
{
- byte buf[IO_SIZE];
uint bytes_in_cache;
DBUG_ENTER("my_b_copy_to_file");
@@ -58,19 +57,17 @@ my_b_copy_to_file(IO_CACHE *cache, FILE *file)
if (reinit_io_cache(cache, READ_CACHE, 0L, FALSE, FALSE))
DBUG_RETURN(1);
bytes_in_cache= my_b_bytes_in_cache(cache);
- while (bytes_in_cache > 0) {
- uint const read_bytes= min(bytes_in_cache, sizeof(buf));
- DBUG_PRINT("debug", ("Remaining %u bytes - Reading %u bytes",
- bytes_in_cache, read_bytes));
- if (my_b_read(cache, buf, read_bytes))
- DBUG_RETURN(1);
- if (my_fwrite(file, buf, read_bytes, MYF(MY_WME | MY_NABP)) == (uint) -1)
+ do
+ {
+ if (my_fwrite(file, cache->read_pos, bytes_in_cache,
+ MYF(MY_WME | MY_NABP)) == (uint) -1)
DBUG_RETURN(1);
- bytes_in_cache -= read_bytes;
- }
+ cache->read_pos= cache->read_end;
+ } while ((bytes_in_cache= my_b_fill(cache)));
DBUG_RETURN(0);
}
+
my_off_t my_b_append_tell(IO_CACHE* info)
{
/*