From 92b29e1a07b27e4b1cbf3b93bc85686ff7ae55ff Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 11 Feb 2022 15:08:07 +0100 Subject: [PATCH] remove solaris implementation The solaris implementation is not used anywhere, and removed from most projects, so we may as well clean up the corresponding files here. Signed-off-by: Sebastiaan van Stijn --- .github/workflows/ci.yml | 1 - console_test.go | 4 ++-- console_unix.go | 4 ++-- pty_unix.go | 4 ++-- tc_solaris_cgo.go | 52 ---------------------------------------- tc_solaris_nocgo.go | 48 ------------------------------------- tc_unix.go | 4 ++-- 7 files changed, 8 insertions(+), 109 deletions(-) delete mode 100644 tc_solaris_cgo.go delete mode 100644 tc_solaris_nocgo.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1971ee1..75529ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,4 +72,3 @@ jobs: go test -race GOOS=openbsd go build GOOS=windows go build - GOOS=solaris go build diff --git a/console_test.go b/console_test.go index 671f2f0..74695ab 100644 --- a/console_test.go +++ b/console_test.go @@ -1,5 +1,5 @@ -//go:build linux || solaris || zos || freebsd -// +build linux solaris zos freebsd +//go:build linux || zos || freebsd +// +build linux zos freebsd /* Copyright The containerd Authors. diff --git a/console_unix.go b/console_unix.go index 164dd59..022ae6c 100644 --- a/console_unix.go +++ b/console_unix.go @@ -1,5 +1,5 @@ -//go:build darwin || freebsd || linux || netbsd || openbsd || solaris -// +build darwin freebsd linux netbsd openbsd solaris +//go:build darwin || freebsd || linux || netbsd || openbsd +// +build darwin freebsd linux netbsd openbsd /* Copyright The containerd Authors. diff --git a/pty_unix.go b/pty_unix.go index b090252..f5a5b80 100644 --- a/pty_unix.go +++ b/pty_unix.go @@ -1,5 +1,5 @@ -//go:build darwin || linux || netbsd || openbsd || solaris -// +build darwin linux netbsd openbsd solaris +//go:build darwin || linux || netbsd || openbsd +// +build darwin linux netbsd openbsd /* Copyright The containerd Authors. diff --git a/tc_solaris_cgo.go b/tc_solaris_cgo.go deleted file mode 100644 index c755a9b..0000000 --- a/tc_solaris_cgo.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build solaris && cgo -// +build solaris,cgo - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package console - -import ( - "os" - - "golang.org/x/sys/unix" -) - -//#include -import "C" - -const ( - cmdTcGet = unix.TCGETS - cmdTcSet = unix.TCSETS -) - -// ptsname retrieves the name of the first available pts for the given master. -func ptsname(f *os.File) (string, error) { - ptspath, err := C.ptsname(C.int(f.Fd())) - if err != nil { - return "", err - } - return C.GoString(ptspath), nil -} - -// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. -// unlockpt should be called before opening the slave side of a pty. -func unlockpt(f *os.File) error { - if _, err := C.grantpt(C.int(f.Fd())); err != nil { - return err - } - return nil -} diff --git a/tc_solaris_nocgo.go b/tc_solaris_nocgo.go deleted file mode 100644 index 29c07d4..0000000 --- a/tc_solaris_nocgo.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build solaris && !cgo -// +build solaris,!cgo - -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// -// Implementing the functions below requires cgo support. Non-cgo stubs -// versions are defined below to enable cross-compilation of source code -// that depends on these functions, but the resultant cross-compiled -// binaries cannot actually be used. If the stub function(s) below are -// actually invoked they will display an error message and cause the -// calling process to exit. -// - -package console - -import ( - "os" - - "golang.org/x/sys/unix" -) - -const ( - cmdTcGet = unix.TCGETS - cmdTcSet = unix.TCSETS -) - -func ptsname(f *os.File) (string, error) { - panic("ptsname() support requires cgo.") -} - -func unlockpt(f *os.File) error { - panic("unlockpt() support requires cgo.") -} diff --git a/tc_unix.go b/tc_unix.go index 947cb75..f5053b2 100644 --- a/tc_unix.go +++ b/tc_unix.go @@ -1,5 +1,5 @@ -//go:build darwin || freebsd || linux || netbsd || openbsd || solaris || zos -// +build darwin freebsd linux netbsd openbsd solaris zos +//go:build darwin || freebsd || linux || netbsd || openbsd || zos +// +build darwin freebsd linux netbsd openbsd zos /* Copyright The containerd Authors.