summaryrefslogtreecommitdiff
path: root/mysys/my_write.c
diff options
context:
space:
mode:
authorkaa@polly.(none) <>2007-10-24 21:39:00 +0400
committerkaa@polly.(none) <>2007-10-24 21:39:00 +0400
commit63ca7570af91eebd392fb7f5d6485e3ef846bb6c (patch)
tree2b77d176292fcbb7078135c6552f5abef52fd3fe /mysys/my_write.c
parentd3293988d879bb9904ced1da80d09479c2fb485e (diff)
parent2c9720c20ec8d0fa341080bdc82ab00063dd4156 (diff)
downloadmariadb-git-63ca7570af91eebd392fb7f5d6485e3ef846bb6c.tar.gz
Merge polly.(none):/home/kaa/src/maint/mysql-5.0-maint
into polly.(none):/home/kaa/src/maint/mysql-5.1-maint
Diffstat (limited to 'mysys/my_write.c')
-rw-r--r--mysys/my_write.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 056a84f1794..1dd4ff5e405 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -29,6 +29,10 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
Filedes, (long) Buffer, (ulong) Count, MyFlags));
errors=0; written=0;
+ /* The behavior of write(fd, buf, 0) is not portable */
+ if (unlikely(!Count))
+ return 0;
+
for (;;)
{
if ((writenbytes= write(Filedes, Buffer, Count)) == Count)