[uClibc-cvs] svn commit: trunk/uClibc/libc/sysdeps/linux/i386

vapier at uclibc.org vapier at uclibc.org
Thu Jul 28 03:58:44 UTC 2005


Author: vapier
Date: 2005-07-27 21:58:43 -0600 (Wed, 27 Jul 2005)
New Revision: 10938

Log:
the errno settings was fixed but the return value was still being clobbered ... fix that too

Modified:
   trunk/uClibc/libc/sysdeps/linux/i386/__syscall_error.c


Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/i386/__syscall_error.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/i386/__syscall_error.c	2005-07-28 03:58:03 UTC (rev 10937)
+++ trunk/uClibc/libc/sysdeps/linux/i386/__syscall_error.c	2005-07-28 03:58:43 UTC (rev 10938)
@@ -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;
 }




More information about the uClibc-cvs mailing list