summaryrefslogtreecommitdiff
path: root/vendor/github.com/Azure/go-ansiterm/winterm
diff options
context:
space:
mode:
authorflouthoc <flouthoc.git@gmail.com>2021-08-25 16:13:17 +0530
committerAditya Rajan <arajan@redhat.com>2021-09-14 13:31:39 +0530
commita55e2a00fcb82485333eeec55aa2eaee338782d7 (patch)
treed465835a368c7f78239d7abd1c2912347bf23d4c /vendor/github.com/Azure/go-ansiterm/winterm
parentb603c7a4b91d30b33ce987740156f46804f24074 (diff)
downloadpodman-a55e2a00fcb82485333eeec55aa2eaee338782d7.tar.gz
podman-a55e2a00fcb82485333eeec55aa2eaee338782d7.tar.bz2
podman-a55e2a00fcb82485333eeec55aa2eaee338782d7.zip
rootfs: Add support for rootfs-overlay and bump to buildah v1.22.1-0.202108
Allows users to specify a readonly rootfs with :O, in exchange podman will create a writable overlay. bump builah to v1.22.1-0.20210823173221-da2b428c56ce [NO TESTS NEEDED] Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Diffstat (limited to 'vendor/github.com/Azure/go-ansiterm/winterm')
-rw-r--r--vendor/github.com/Azure/go-ansiterm/winterm/ansi.go24
1 files changed, 19 insertions, 5 deletions
diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go b/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go
index a67327972..5599082ae 100644
--- a/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go
+++ b/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go
@@ -10,6 +10,7 @@ import (
"syscall"
"github.com/Azure/go-ansiterm"
+ windows "golang.org/x/sys/windows"
)
// Windows keyboard constants
@@ -162,15 +163,28 @@ func ensureInRange(n int16, min int16, max int16) int16 {
func GetStdFile(nFile int) (*os.File, uintptr) {
var file *os.File
- switch nFile {
- case syscall.STD_INPUT_HANDLE:
+
+ // syscall uses negative numbers
+ // windows package uses very big uint32
+ // Keep these switches split so we don't have to convert ints too much.
+ switch uint32(nFile) {
+ case windows.STD_INPUT_HANDLE:
file = os.Stdin
- case syscall.STD_OUTPUT_HANDLE:
+ case windows.STD_OUTPUT_HANDLE:
file = os.Stdout
- case syscall.STD_ERROR_HANDLE:
+ case windows.STD_ERROR_HANDLE:
file = os.Stderr
default:
- panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile))
+ switch nFile {
+ case syscall.STD_INPUT_HANDLE:
+ file = os.Stdin
+ case syscall.STD_OUTPUT_HANDLE:
+ file = os.Stdout
+ case syscall.STD_ERROR_HANDLE:
+ file = os.Stderr
+ default:
+ panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile))
+ }
}
fd, err := syscall.GetStdHandle(nFile)