diff options
| author | Elliott Hughes <enh@google.com> | 2012-09-11 16:38:43 -0700 |
|---|---|---|
| committer | android code review <noreply-gerritcodereview@google.com> | 2012-09-11 16:38:43 -0700 |
| commit | cc8668f261ae5d0ed38961f357e33c026502ed0d (patch) | |
| tree | 47caa97d67a6489715e908ed3f2e4464b3ff2ae4 | |
| parent | 59726beda5bec7e3db9d0c403a0ef11d0a7f182f (diff) | |
| parent | b03bc56b7930d60237f1dd1ed40f23c2635929c9 (diff) | |
| download | bionic-cc8668f261ae5d0ed38961f357e33c026502ed0d.zip bionic-cc8668f261ae5d0ed38961f357e33c026502ed0d.tar.gz bionic-cc8668f261ae5d0ed38961f357e33c026502ed0d.tar.bz2 | |
Merge "[MIPS] Check error status from pipe system call"
| -rw-r--r-- | libc/arch-mips/bionic/pipe.S | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/libc/arch-mips/bionic/pipe.S b/libc/arch-mips/bionic/pipe.S index 8556569..0baf246 100644 --- a/libc/arch-mips/bionic/pipe.S +++ b/libc/arch-mips/bionic/pipe.S @@ -26,6 +26,12 @@ * SUCH DAMAGE. */ +/* + * The MIPS pipe syscall returns results in two registers, which + * we have to copy into the supplied array. This prevents us from + * using an auto-generated stub. + */ + #include <asm/unistd.h> .text @@ -38,12 +44,17 @@ .ent pipe pipe: .set noreorder - + .cpload $t9 li $v0,__NR_pipe syscall /* syscall returns results in v0,v1 */ - - sw $v0,0($a0) - sw $v1,4($a0) + bnez $a3, 1f /* check errno */ + nop + sw $v0, 0($a0) + sw $v1, 4($a0) j $ra - move $v0,$zero + move $v0, $zero +1: + la $t9, __set_errno + j $t9 + move $a0, $v0 /* delay slot, prepare args for __set_errno */ .end pipe |
