summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/i386/fallocate.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2010-04-08 15:44:55 -0700
committerUlrich Drepper <drepper@redhat.com>2010-04-08 15:44:55 -0700
commitde240a05b3638879af2f9ab663c56ad8b26b1ad3 (patch)
tree4f649407ca3d38583c561bf9f73df6ce709d6d06 /sysdeps/unix/sysv/linux/i386/fallocate.c
parent88e236a627d7195a938bce0b7cde92c2da2abedf (diff)
downloadglibc-de240a05b3638879af2f9ab663c56ad8b26b1ad3.tar.gz
Fix fallocate error return on i386.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/fallocate.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/fallocate.c8
1 files changed, 7 insertions, 1 deletions
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;