]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: allow fake time writes to both stdout and stderr
authorAndrew Gerrand <adg@golang.org>
Tue, 13 Jan 2015 05:33:55 +0000 (16:33 +1100)
committerAndrew Gerrand <adg@golang.org>
Tue, 13 Jan 2015 05:43:32 +0000 (05:43 +0000)
In the previous sandbox implementation we read all sandboxed output
from standard output, and so all fake time writes were made to
standard output. Now we have a more sophisticated sandbox server
(see golang.org/x/playground/sandbox) that is capable of recording
both standard output and standard error, so allow fake time writes to
go to either file descriptor.

Change-Id: I79737deb06fd8e0f28910f21f41bd3dc1726781e
Reviewed-on: https://go-review.googlesource.com/2713
Reviewed-by: Minux Ma <minux@golang.org>
src/runtime/sys_nacl_amd64p32.s

index f5624ca8dfd0837630deb80a0bfc54ad650c8b3e..7657482fd134b95065511989c3bf44432e4b006c 100644 (file)
@@ -94,13 +94,13 @@ playback:
        MOVL n+8(FP), DX
        BSWAPL DX
        MOVL DX, 12(SP)
-       MOVL $1, DI // standard output
+       MOVL fd+0(FP), DI
        MOVL SP, SI
        MOVL $16, DX
        NACL_SYSCALL(SYS_write)
 
        // Write actual data.
-       MOVL $1, DI // standard output
+       MOVL fd+0(FP), DI
        MOVL p+4(FP), SI
        MOVL n+8(FP), DX
        NACL_SYSCALL(SYS_write)