diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-02-28 22:47:29 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-02-28 22:47:29 +0100 |
commit | 213f1c76a038ad0e6111cd5eb6b0da9b4b9dc45a (patch) | |
tree | 79e9a941a078d73ce85da0241871a863fa4eca38 /mysys | |
parent | cfa94b4338b5dd5578436df0402b2f2210de3eaa (diff) | |
parent | c4341d50950224bb4e976fd1aac23dddc7d78f71 (diff) | |
download | mariadb-git-213f1c76a038ad0e6111cd5eb6b0da9b4b9dc45a.tar.gz |
5.3->5.5 merge
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/errors.c | 2 | ||||
-rw-r--r-- | mysys/mf_pack.c | 2 | ||||
-rw-r--r-- | mysys/my_write.c | 16 |
3 files changed, 13 insertions, 7 deletions
diff --git a/mysys/errors.c b/mysys/errors.c index 4f8f6f26c2a..1063cae8856 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -53,7 +53,7 @@ const char *globerrs[GLOBERRS]= "File '%s' (fileno: %d) was not closed", "Can't change ownership of the file '%s' (Errcode: %d)", "Can't change permissions of the file '%s' (Errcode: %d)", - "Can't seek in file '%s' (Errcode: %d)" + "Can't seek in file '%s' (Errcode: %d)", "Can't change mode for file '%s' to 0x%lx (Error: %d)", "Warning: Can't copy ownership for file '%s' (Error: %d)" }; diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index 5bbafeb9945..d684be238e6 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2012, Monty Program Ab + Copyright (c) 2012, 2013, Monty Program Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/mysys/my_write.c b/mysys/my_write.c index c4cba7a927d..4997a4a804a 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) |