summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/fallocate64.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/fallocate64.c')
-rw-r--r--libc/sysdeps/linux/common/fallocate64.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/common/fallocate64.c b/libc/sysdeps/linux/common/fallocate64.c
index cf75693d6..1aa351ebe 100644
--- a/libc/sysdeps/linux/common/fallocate64.c
+++ b/libc/sysdeps/linux/common/fallocate64.c
@@ -13,6 +13,7 @@
#include <fcntl.h>
#include <bits/kernel-features.h>
#include <stdint.h>
+#include <errno.h>
#if defined __NR_fallocate
@@ -27,9 +28,11 @@ int attribute_hidden __libc_fallocate64(int fd, int mode, __off64_t offset,
INTERNAL_SYSCALL_DECL(err);
ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, mode,
OFF64_HI_LO (offset), OFF64_HI_LO (len)));
- if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+ if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) {
+ __set_errno(INTERNAL_SYSCALL_ERRNO (ret, err));
+ ret = -1;
+ }
+ return ret;
}
# if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU