summaryrefslogtreecommitdiff
path: root/mysys/my_write.c
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-08-22 16:13:54 +0200
committerSergei Golubchik <sergii@pisem.net>2012-08-22 16:13:54 +0200
commit1fd8150a5b5e3f56aa3c253225929a07ee9a4026 (patch)
tree6fb814b28d2a0b8227b7a9f835f2b888c2a2596f /mysys/my_write.c
parent60561ae6133cf40f4fc445e1d6e8f395a20b2573 (diff)
parent115a2967563d3ac734ce371260098710ba42cdf0 (diff)
downloadmariadb-git-1fd8150a5b5e3f56aa3c253225929a07ee9a4026.tar.gz
5.1 merge
increase xtradb verson from 13.0 to 13.01
Diffstat (limited to 'mysys/my_write.c')
-rw-r--r--mysys/my_write.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 07dbfe8eb40..17f6131b617 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -40,7 +40,17 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
for (;;)
{
- if ((writenbytes= write(Filedes, Buffer, Count)) == Count)
+ writenbytes= write(Filedes, Buffer, Count);
+ /**
+ To simulate the write error set the errno = error code
+ and the number pf written bytes to -1.
+ */
+ DBUG_EXECUTE_IF ("simulate_file_write_error",
+ {
+ errno= ENOSPC;
+ writenbytes= (size_t) -1;
+ });
+ if (writenbytes == Count)
break;
if (writenbytes != (size_t) -1)
{ /* Safeguard */