Skip to content

Commit

Permalink
runtime/cgo: use fatalf on solaris
Browse files Browse the repository at this point in the history
Change-Id: I3302cc2f0e03014e9497976e36d1c7a381a2f962
Reviewed-on: https://go-review.googlesource.com/c/go/+/518623
Run-TryBot: Joel Sing <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
4a6f656c committed Aug 15, 2023
1 parent b51a4dd commit fc212a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/runtime/cgo/gcc_fatalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 2 additions & 4 deletions src/runtime/cgo/gcc_solaris_amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down Expand Up @@ -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));
}
}

Expand Down

0 comments on commit fc212a9

Please sign in to comment.