diff --git a/internal/native/message_server.go b/internal/native/message_server.go index 86936320d..31629ba84 100644 --- a/internal/native/message_server.go +++ b/internal/native/message_server.go @@ -237,7 +237,6 @@ func (m *MessageServer) UsingPlugin(pluginName string, pluginVersion string) err defer free(cPluginVersion) r := C.pactffi_using_plugin(m.messagePact.handle, cPluginName, cPluginVersion) - InstallSignalHandlers() // 1 - A general panic was caught. // 2 - Failed to load the plugin. diff --git a/internal/native/mock_server.go b/internal/native/mock_server.go index 1444cb564..2429301c1 100644 --- a/internal/native/mock_server.go +++ b/internal/native/mock_server.go @@ -398,7 +398,6 @@ func (m *MockServer) UsingPlugin(pluginName string, pluginVersion string) error defer free(cPluginVersion) r := C.pactffi_using_plugin(m.pact.handle, cPluginName, cPluginVersion) - InstallSignalHandlers() // 1 - A general panic was caught. // 2 - Failed to load the plugin. diff --git a/internal/native/signal.go b/internal/native/signal.go deleted file mode 100644 index 8757e47d7..000000000 --- a/internal/native/signal.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build cgo -// +build cgo - -package native - -/* -#if defined(__APPLE__) || defined(__linux__) -// https://github.com/wailsapp/wails/pull/2152/files#diff-d4a0fa73df7b0ab971e550f95249e358b634836e925ace96f7400480916ac09e -#include -#include -#include -#include - -static void fix_signal(int signum) -{ - struct sigaction st; - - if (sigaction(signum, NULL, &st) < 0) { - goto fix_signal_error; - } - st.sa_flags |= SA_ONSTACK; - if (sigaction(signum, &st, NULL) < 0) { - goto fix_signal_error; - } - return; -fix_signal_error: - fprintf(stderr, "error fixing handler for signal %d, please " - "report this issue to " - "https://github.com/pact-foundation/pact-go: %s\n", - signum, strerror(errno)); -} - -static void install_signal_handlers() -{ -#if defined(SIGCHLD) - fix_signal(SIGCHLD); -#endif -#if defined(SIGHUP) - fix_signal(SIGHUP); -#endif -#if defined(SIGINT) - fix_signal(SIGINT); -#endif -#if defined(SIGQUIT) - fix_signal(SIGQUIT); -#endif -#if defined(SIGABRT) - fix_signal(SIGABRT); -#endif -#if defined(SIGFPE) - fix_signal(SIGFPE); -#endif -#if defined(SIGTERM) - fix_signal(SIGTERM); -#endif -#if defined(SIGBUS) - fix_signal(SIGBUS); -#endif -#if defined(SIGSEGV) - fix_signal(SIGSEGV); -#endif -#if defined(SIGXCPU) - fix_signal(SIGXCPU); -#endif -#if defined(SIGXFSZ) - fix_signal(SIGXFSZ); -#endif -} -#else - static void install_signal_handlers() - { - } -#endif -*/ -import "C" -import ( - "os" - "runtime" -) - -func InstallSignalHandlers() { - if os.Getenv("PACT_GO_INSTALL_SIGNAL_HANDLERS") != "0" { - if runtime.GOOS != "windows" { - C.install_signal_handlers() - } - } -} diff --git a/internal/native/verifier.go b/internal/native/verifier.go index 26d41fd53..3f03df269 100644 --- a/internal/native/verifier.go +++ b/internal/native/verifier.go @@ -195,7 +195,6 @@ func (v *Verifier) SetPublishOptions(providerVersion string, buildUrl string, pr func (v *Verifier) Execute() error { // TODO: Validate - InstallSignalHandlers() result := C.pactffi_verifier_execute(v.handle) /// | Error | Description |