summaryrefslogtreecommitdiff
path: root/mysys/my_write.c
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-27 23:41:02 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-27 23:41:02 +0100
commit993ea79f2df42292eceeee394e8ece9f4a3f6cf2 (patch)
treed105c8288a89a25d412e9006b740c756db6326d6 /mysys/my_write.c
parent1827d9591e24ee469527021771088d842ab18374 (diff)
parent6599fd3e9c23a8957a63146cbe6a0ffc4c292a3d (diff)
downloadmariadb-git-993ea79f2df42292eceeee394e8ece9f4a3f6cf2.tar.gz
5.5 merge
Diffstat (limited to 'mysys/my_write.c')
-rw-r--r--mysys/my_write.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 204e2e1488d..3c94fab2ec7 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -47,11 +47,17 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
#else
writtenbytes= write(Filedes, Buffer, Count);
#endif
- DBUG_EXECUTE_IF("simulate_file_write_error",
- {
- errno= ENOSPC;
- writtenbytes= (size_t) -1;
- });
+
+ /**
+ 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",
+ if (!errors) {
+ errno= ENOSPC;
+ writtenbytes= (size_t) -1;
+ });
+
if (writtenbytes == Count)
break;
if (writtenbytes != (size_t) -1)