]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: use fatalf on solaris
authorJoel Sing <joel@sing.id.au>
Fri, 11 Aug 2023 13:08:25 +0000 (23:08 +1000)
committerJoel Sing <joel@sing.id.au>
Tue, 15 Aug 2023 14:57:16 +0000 (14:57 +0000)
Change-Id: I3302cc2f0e03014e9497976e36d1c7a381a2f962
Reviewed-on: https://go-review.googlesource.com/c/go/+/518623
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/runtime/cgo/gcc_fatalf.c
src/runtime/cgo/gcc_solaris_amd64.c

index d7425ea48045251a71172e149a1c8f10f949cf9a..822c0150bdc48297781f859b5d07e60d05667c2d 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build aix || (!android && linux) || dragonfly || freebsd || netbsd || openbsd
+//go:build aix || (!android && linux) || dragonfly || freebsd || netbsd || openbsd || solaris
 
 #include <stdarg.h>
 #include <stdio.h>
index 1773f3fff040d434cccc815f1a791d050ab6ac48..9b106a63ea08b6388d13ae64ab28fd6447b6e844 100644 (file)
@@ -31,8 +31,7 @@ x_cgo_init(G *g, void (*setg)(void*))
        // Sanity check the results now, rather than getting a
        // morestack on g0 crash.
        if (g->stacklo >= g->stackhi) {
-               fprintf(stderr, "runtime/cgo: bad stack bounds: lo=%p hi=%p\n", (void*)(g->stacklo), (void*)(g->stackhi));
-               abort();
+               fatalf("bad stack bounds: lo=%p hi=%p", (void*)(g->stacklo), (void*)(g->stackhi));
        }
 }
 
@@ -66,8 +65,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
        pthread_sigmask(SIG_SETMASK, &oset, nil);
 
        if (err != 0) {
-               fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
-               abort();
+               fatalf("pthread_create failed: %s", strerror(err));
        }
 }