]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: change tfork behaviour to unbreak openbsd/mips64
authorJoel Sing <joel@sing.id.au>
Thu, 17 Nov 2022 01:51:56 +0000 (12:51 +1100)
committerJoel Sing <joel@sing.id.au>
Sat, 19 Nov 2022 03:33:26 +0000 (03:33 +0000)
Currently, tfork on openbsd/mips64 returns the thread ID on success and
a negative error number on error. In CL#447175, newosproc was changed
to assume that a non-zero value is an error - return zero on success to
match this expectation.

Change-Id: I955efad49b149146165eba3d05fe40ba75caa098
Reviewed-on: https://go-review.googlesource.com/c/go/+/451257
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Joel Sing <joel@sing.id.au>

src/runtime/sys_openbsd_mips64.s

index cc37e52e16150ec558770bf59ae6f6dfddf05280..affd586742ef0408effb66a6717dc6ae84abbe2e 100644 (file)
@@ -277,7 +277,7 @@ TEXT runtime·tfork(SB),NOSPLIT,$0
 
        // In parent, return.
        BEQ     R2, 3(PC)
-       MOVW    R2, ret+40(FP)
+       MOVW    $0, ret+40(FP)
        RET
 
        // Initialise m, g.