From de240a05b3638879af2f9ab663c56ad8b26b1ad3 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 8 Apr 2010 15:44:55 -0700 Subject: Fix fallocate error return on i386. --- sysdeps/unix/sysv/linux/i386/fallocate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix/sysv/linux/i386/fallocate.c') diff --git a/sysdeps/unix/sysv/linux/i386/fallocate.c b/sysdeps/unix/sysv/linux/i386/fallocate.c index 14e788386c..1434a833f9 100644 --- a/sysdeps/unix/sysv/linux/i386/fallocate.c +++ b/sysdeps/unix/sysv/linux/i386/fallocate.c @@ -30,7 +30,13 @@ int fallocate (int fd, int mode, __off_t offset, __off_t len) { #ifdef __NR_fallocate - return __call_fallocate (fd, mode, offset, len); + int err = __call_fallocate (fd, mode, offset, len); + if (__builtin_expect (err, 0)) + { + __set_errno (err); + err = -1; + } + return err; #else __set_errno (ENOSYS); return -1; -- cgit v1.2.1