diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-07-28 03:58:43 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-07-28 03:58:43 +0000 |
commit | 8ba79833fb4d29d14db437864747d20d4137cf3a (patch) | |
tree | 11cdc9cafea8cd7c1ca388ba2b9ec7ddd72dc890 /libc | |
parent | d49ea365adf8e0d7ec8a4e6a25b7d87456224697 (diff) |
the errno settings was fixed but the return value was still being clobbered ... fix that too
Diffstat (limited to 'libc')
-rw-r--r-- | libc/sysdeps/linux/i386/__syscall_error.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libc/sysdeps/linux/i386/__syscall_error.c b/libc/sysdeps/linux/i386/__syscall_error.c index 507cf2ab7..133500cb6 100644 --- a/libc/sysdeps/linux/i386/__syscall_error.c +++ b/libc/sysdeps/linux/i386/__syscall_error.c @@ -36,10 +36,11 @@ * We have to stash the errno from %eax in a local stack var because * __set_errno will prob call a function thus clobbering %eax on us. */ -void attribute_hidden __syscall_error(void) +int attribute_hidden __syscall_error(void) { - register int eax asm("%eax"); - int stack = -eax; - __set_errno(stack); - eax = -1; + register int edx asm("%edx"); + asm("mov %eax, %edx"); + asm("negl %edx"); + __set_errno(edx); + return -1; } |