From de7054fd74a09070243a44c1faf3158d8c2b7c76 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 3 Nov 2021 09:57:35 +0100 Subject: [PATCH] fix: use x-platform code for pdeathsig This might cause the macosx build not to fail, I hope. See https://github.com/docker/cli/tree/v20.10.10/cli/connhelper/commandconn --- pkg/upstream/commandconn/commandconn.go | 4 ---- pkg/upstream/commandconn/pdeathsig_linux.go | 10 ++++++++++ pkg/upstream/commandconn/pdeathsig_nolinux.go | 11 +++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 pkg/upstream/commandconn/pdeathsig_linux.go create mode 100644 pkg/upstream/commandconn/pdeathsig_nolinux.go diff --git a/pkg/upstream/commandconn/commandconn.go b/pkg/upstream/commandconn/commandconn.go index 7fce5ff8..7df44f6e 100644 --- a/pkg/upstream/commandconn/commandconn.go +++ b/pkg/upstream/commandconn/commandconn.go @@ -32,10 +32,6 @@ import ( exec "golang.org/x/sys/execabs" ) -func setPdeathsig(cmd *exec.Cmd) { - cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL -} - func createSession(cmd *exec.Cmd) { // for supporting ssh connection helper with ProxyCommand // https://github.com/docker/cli/issues/1707 diff --git a/pkg/upstream/commandconn/pdeathsig_linux.go b/pkg/upstream/commandconn/pdeathsig_linux.go new file mode 100644 index 00000000..1cdd788c --- /dev/null +++ b/pkg/upstream/commandconn/pdeathsig_linux.go @@ -0,0 +1,10 @@ +package commandconn + +import ( + "os/exec" + "syscall" +) + +func setPdeathsig(cmd *exec.Cmd) { + cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL +} diff --git a/pkg/upstream/commandconn/pdeathsig_nolinux.go b/pkg/upstream/commandconn/pdeathsig_nolinux.go new file mode 100644 index 00000000..2adcf081 --- /dev/null +++ b/pkg/upstream/commandconn/pdeathsig_nolinux.go @@ -0,0 +1,11 @@ +//go:build !linux +// +build !linux + +package commandconn + +import ( + "os/exec" +) + +func setPdeathsig(cmd *exec.Cmd) { +}