about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/ftruncate64.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/ftruncate64.c')
-rw-r--r--sysdeps/unix/sysv/linux/ftruncate64.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/ftruncate64.c b/sysdeps/unix/sysv/linux/ftruncate64.c
index 6644b0523c..47df34ec7e 100644
--- a/sysdeps/unix/sysv/linux/ftruncate64.c
+++ b/sysdeps/unix/sysv/linux/ftruncate64.c
@@ -43,6 +43,9 @@ ftruncate64 (fd, length)
     {
       unsigned int low = length & 0xffffffff;
       unsigned int high = length >> 32;
+#ifndef __ASSUME_TRUNCATE64_SYSCALL
+      int saved_errno = errno;
+#endif
       int result = INLINE_SYSCALL (ftruncate64, 3, fd, low, high);
 
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
@@ -51,6 +54,7 @@ ftruncate64 (fd, length)
 	return result;
 
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
+      __set_errno (saved_errno);
       have_no_ftruncate64 = 1;
 #endif
     }