summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@nosik.monty.fi>2008-01-31 03:11:10 +0200
committerunknown <monty@nosik.monty.fi>2008-01-31 03:11:10 +0200
commit0857a6930d38602ec8d17fa1aa80bcf9e4ee1f5d (patch)
tree8d8c68727c21b96332949081b7da5f02bc1bceab /mysys
parentb51c819ce1f949a127dce99e1c63e541ebb80d03 (diff)
parentab0fa111fef1afbd04156624cdb29781f08adcac (diff)
downloadmariadb-git-0857a6930d38602ec8d17fa1aa80bcf9e4ee1f5d.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-maria
into mysql.com:/home/my/mysql-maria mysys/my_pread.c: Auto merged mysys/my_read.c: Auto merged storage/maria/ha_maria.cc: Auto merged storage/maria/ma_blockrec.c: Auto merged storage/maria/ma_check.c: Auto merged storage/maria/ma_loghandler.c: Auto merged storage/maria/ma_page.c: Auto merged storage/maria/ma_write.c: Auto merged storage/maria/maria_chk.c: Auto merged storage/maria/maria_def.h: Auto merged
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_pread.c5
-rw-r--r--mysys/my_read.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/mysys/my_pread.c b/mysys/my_pread.c
index cfccc40a782..3dff034c15b 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -70,11 +70,12 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
if ((error= ((readbytes= pread(Filedes, Buffer, Count, offset)) != Count)))
{
my_errno= errno;
- if (errno == 0 || (errno == -1 && (MyFlags & (MY_NABP | MY_FNABP))))
+ if (errno == 0 || (readbytes == (size_t) -1 &&
+ (MyFlags & (MY_NABP | MY_FNABP))))
my_errno= HA_ERR_FILE_TOO_SHORT;
}
#endif
- if (error || readbytes != Count)
+ if (error)
{
DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d",
(int) readbytes, (uint) Count,Filedes,my_errno));
diff --git a/mysys/my_read.c b/mysys/my_read.c
index 0d6c8d14416..64f2cf42b4c 100644
--- a/mysys/my_read.c
+++ b/mysys/my_read.c
@@ -51,7 +51,8 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
if ((readbytes= read(Filedes, Buffer, Count)) != Count)
{
my_errno= errno;
- if (errno == 0 || (errno == -1 && (MyFlags & (MY_NABP | MY_FNABP))))
+ if (errno == 0 || (readbytes == (size_t) -1 &&
+ (MyFlags & (MY_NABP | MY_FNABP))))
my_errno= HA_ERR_FILE_TOO_SHORT;
DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d",
(int) readbytes, (ulong) Count, Filedes,