[uClibc-cvs] uClibc/libc/sysdeps/linux/arm syscall.c,1.2,1.3

Erik Andersen andersen at uclibc.org
Wed May 5 06:56:06 UTC 2004


Update of /var/cvs/uClibc/libc/sysdeps/linux/arm
In directory nail:/tmp/cvs-serv13298/libc/sysdeps/linux/arm

Modified Files:
	syscall.c 
Log Message:
Jeroen Dobbelaere writes:

Because variables are linked to fixed registers, there is a problem in :
     (*__errno_location())=(-_r0);

As __errno_location() uses r0 to return the address of the errno location,
the negated address will be assigned instead of the error code.

Attached patch will resolve this.



Index: syscall.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/arm/syscall.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/syscall.c	11 Jun 2003 01:45:27 -0000	1.2
+++ b/syscall.c	5 May 2004 06:56:03 -0000	1.3
@@ -41,7 +41,8 @@
 	      "r"(_r6)
 	    : "memory");
     if(_r0 >=(unsigned long) -4095) {
-	(*__errno_location())=(-_r0);
+	long err = _r0;
+	(*__errno_location())=(-err);
 	_r0=(unsigned long) -1;
     }
     return (long) _r0;




More information about the uClibc-cvs mailing list