Some archs (avr32 in particular) still doesn't define __NR_pread64, so
we should fall back to __NR_pread if it isn't available.

The code nicely checks for it, but then ends up hard coding the syscall
to use __NR_pread64 afterwards, rendering the check useless. Fix it by
using the result of the test instead.

Signed-off-by: Peter Korsgaard <pe...@korsgaard.com>
---
Noticed when adding the pending patches for 0.9.33.3 to Buildroot:
http://jenkins.free-electrons.com/job/buildroot/config=atstk100x_defconfig/116/console

 libc/sysdeps/linux/common/pread_write.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/sysdeps/linux/common/pread_write.c 
b/libc/sysdeps/linux/common/pread_write.c
index b13de66..8562ab4 100644
--- a/libc/sysdeps/linux/common/pread_write.c
+++ b/libc/sysdeps/linux/common/pread_write.c
@@ -42,7 +42,7 @@ extern __typeof(pwrite64) __libc_pwrite64;
 
 #include <bits/kernel_types.h>
 
-# define __NR___syscall_pread __NR_pread64
+# define __NR___syscall_pread __NR_pread
 static __inline__ _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
                size_t, count, off_t, offset_hi, off_t, offset_lo)
 
-- 
1.7.10.4

_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to