summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/i386/__syscall_error.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libc/sysdeps/linux/i386/__syscall_error.c b/libc/sysdeps/linux/i386/__syscall_error.c
index 7509d4409..36946bc6d 100644
--- a/libc/sysdeps/linux/i386/__syscall_error.c
+++ b/libc/sysdeps/linux/i386/__syscall_error.c
@@ -28,9 +28,8 @@
int __syscall_error(void) attribute_hidden;
int __syscall_error(void)
{
- register int edx __asm__ ("%edx");
- __asm__ ("mov %eax, %edx\n\t"
- "negl %edx");
- __set_errno (edx);
+ register int eax __asm__ ("%eax");
+ int _errno = -eax;
+ __set_errno (_errno);
return -1;
}