summaryrefslogtreecommitdiff
path: root/mysys/my_pread.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/my_pread.c')
-rw-r--r--mysys/my_pread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mysys/my_pread.c b/mysys/my_pread.c
index e0218cd1f1f..d3e308ad70f 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -66,11 +66,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));