summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <kaa@polly.(none)>2007-10-24 21:30:38 +0400
committerunknown <kaa@polly.(none)>2007-10-24 21:30:38 +0400
commitc58cebf683d05aac4f4f8d7087c8fa780ecf0c79 (patch)
tree48f53bfee73eb453183a38e86310e7617fec974b /mysys
parent57d74b5c9883add4a43b1f0f1c5d3c539e67edba (diff)
parentb260e144a591706141b48e49fd1b6a5c302a20f0 (diff)
downloadmariadb-git-c58cebf683d05aac4f4f8d7087c8fa780ecf0c79.tar.gz
Merge polly.(none):/home/kaa/src/maint/bug31566/my50-bug31566
into polly.(none):/home/kaa/src/maint/mysql-5.0-maint
Diffstat (limited to 'mysys')
-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 4c3d187e4e8..08d70accd57 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -29,6 +29,10 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
Filedes, (long) Buffer, Count, MyFlags));
errors=0; written=0L;
+ /* The behavior of write(fd, buf, 0) is not portable */
+ if (unlikely(!Count))
+ return 0;
+
for (;;)
{
if ((writenbytes = (uint) write(Filedes, Buffer, Count)) == Count)