summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-06-17 19:01:15 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2019-06-17 19:01:15 +0100
commit71eea0c3fb87f37f6377c9bdad9339b664b11d0f (patch)
treebfc973c7bb402ef8078d5d987d4294db4803d952 /mysys
parent5804bb4ef0acd7ac42e628c2d8c404957dc86cf9 (diff)
downloadmariadb-git-71eea0c3fb87f37f6377c9bdad9339b664b11d0f.tar.gz
Fix debug assert to match its intention.
Do not check my_errno before it is set, check errno instead. Also, do not check errno, if prior pread() did not fail.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_pread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/my_pread.c b/mysys/my_pread.c
index 9713deebbe5..9d3fdb3e0ee 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -69,7 +69,7 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
if (readbytes != Count)
{
/* We should never read with wrong file descriptor! */
- DBUG_ASSERT(my_errno != EBADF);
+ DBUG_ASSERT(readbytes != (size_t)-1 || errno != EBADF);
my_errno= errno;
if (errno == 0 || (readbytes != (size_t) -1 &&
(MyFlags & (MY_NABP | MY_FNABP))))