svn commit: branches/uClibc_0_9_29/libc/sysdeps/linux/mips

vapier at uclibc.org vapier at uclibc.org
Sat Jan 5 17:15:44 UTC 2008


Author: vapier
Date: 2008-01-05 09:15:44 -0800 (Sat, 05 Jan 2008)
New Revision: 20737

Log:
Merge r18677 by sjhill from trunk:
Fix MIPS syscall() and pipe functions to set errno correctly as reported by Daniel Jacobowitz on the mailing list. More information available at <http://www.uclibc.org/lists/uclibc/2007-May/017968.html> .


Modified:
   branches/uClibc_0_9_29/libc/sysdeps/linux/mips/pipe.S
   branches/uClibc_0_9_29/libc/sysdeps/linux/mips/syscall.S


Changeset:
Modified: branches/uClibc_0_9_29/libc/sysdeps/linux/mips/pipe.S
===================================================================
--- branches/uClibc_0_9_29/libc/sysdeps/linux/mips/pipe.S	2008-01-05 17:15:25 UTC (rev 20736)
+++ branches/uClibc_0_9_29/libc/sysdeps/linux/mips/pipe.S	2008-01-05 17:15:44 UTC (rev 20737)
@@ -17,7 +17,16 @@
 pipe:
 	li	v0,__NR_pipe
 	syscall
-	beqz	a3, 1f
+	bnez	a3, 1f
+	sw	v0, 0(a0)
+	sw	v1, 4(a0)
+	li	v0, 0
+	j	ra
+1:
+	/* uClibc change -- start */
+	move		a0,v0		/* Pass return val to C function. */
+	/* uClibc change -- stop */
+
 #ifdef __PIC__
 	PTR_LA	t9, __syscall_error
 	jr	t9
@@ -25,10 +34,6 @@
 	j	__syscall_error
 #endif
 1:
-	sw	v0, 0(a0)
-	sw	v1, 4(a0)
-	li	v0, 0
-	j	ra
 	.end	pipe
 	.size	pipe,.-pipe
 libc_hidden_def(pipe)

Modified: branches/uClibc_0_9_29/libc/sysdeps/linux/mips/syscall.S
===================================================================
--- branches/uClibc_0_9_29/libc/sysdeps/linux/mips/syscall.S	2008-01-05 17:15:25 UTC (rev 20736)
+++ branches/uClibc_0_9_29/libc/sysdeps/linux/mips/syscall.S	2008-01-05 17:15:44 UTC (rev 20737)
@@ -60,6 +60,16 @@
 #else
 	addiu	sp,sp,32
 #endif
+	bnez	a3, 1f
      	j ra			/* Return to caller.  */
+1:
+	move		a0,v0		/* Pass return val to C function. */
+
+#ifdef __PIC__
+	PTR_LA	t9, __syscall_error
+	jr	t9
+#else
+	j	__syscall_error
+#endif
 .end    syscall
 .size   syscall,.-syscall




More information about the uClibc-cvs mailing list