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 eef92b9ebc6..a829caa80d2 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -66,8 +66,9 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
pthread_mutex_unlock(&my_file_info[Filedes].mutex);
#else
- error=((readbytes = (uint) pread(Filedes, Buffer, Count, offset)) != Count);
- my_errno= errno;
+ if ((error= ((readbytes =
+ (uint) pread(Filedes, Buffer, Count, offset)) != Count)))
+ my_errno= errno;
#endif
if (error || readbytes != Count)
{