Fix fallocate error return on i386.

This commit is contained in:
Andreas Schwab 2010-04-08 15:44:55 -07:00 committed by Ulrich Drepper
parent 88e236a627
commit de240a05b3
3 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-04-07 Andreas Schwab <schwab@redhat.com>
* sysdeps/unix/sysv/linux/i386/fallocate.c: Set errno on error.
* sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.
2010-04-08 Andreas Jaeger <aj@suse.de>
[BZ #10401]

View File

@ -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;

View File

@ -30,7 +30,13 @@ int
fallocate64 (int fd, int mode, __off64_t offset, __off64_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;