Skip to content
Permalink
Browse files

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.
  • Loading branch information...
vaintroub committed Jun 17, 2019
1 parent 5804bb4 commit 71eea0c3fb87f37f6377c9bdad9339b664b11d0f
Showing with 1 addition and 1 deletion.
  1. +1 −1 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))))

0 comments on commit 71eea0c

Please sign in to comment.
You can’t perform that action at this time.