summaryrefslogtreecommitdiff
path: root/mysys/my_pread.c
diff options
context:
space:
mode:
authorunknown <petr@mysql.com>2006-06-30 03:28:58 +0400
committerunknown <petr@mysql.com>2006-06-30 03:28:58 +0400
commit8299fa3f9e5d459641e01b51e9c016dba08dfbf4 (patch)
tree61671b184754212c2d12253f0bffd1c67ccd1fde /mysys/my_pread.c
parent4efb7ac990323804b6211347268469a376555678 (diff)
downloadmariadb-git-8299fa3f9e5d459641e01b51e9c016dba08dfbf4.tar.gz
fix test failures
mysys/my_pread.c: don't set errno without a real error
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)
{