about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/lockf64.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/lockf64.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/lockf64.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/lockf64.c b/sysdeps/unix/sysv/linux/i386/lockf64.c
index 601af783d6..6f9ce0d5d6 100644
--- a/sysdeps/unix/sysv/linux/i386/lockf64.c
+++ b/sysdeps/unix/sysv/linux/i386/lockf64.c
@@ -45,7 +45,8 @@ lockf64 (int fd, int cmd, off64_t len64)
       INTERNAL_SYSCALL_DECL (err);
       result = INTERNAL_SYSCALL (fcntl64, err, 3, fd, F_GETLK64, &fl64);
       if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err)))
-	return INLINE_SYSCALL_ERROR_RETURN_VALUE (-result);
+	return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result,
+									  err));
       if (fl64.l_type == F_UNLCK || fl64.l_pid == __getpid ())
         return 0;
       return INLINE_SYSCALL_ERROR_RETURN_VALUE (EACCES);