]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/mattn/go-isatty/isatty_linux.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / mattn / go-isatty / isatty_linux.go
index 9d24bac1db35b7a83dccbcc86a464265990571fc..e004038ee70446597c29c14e924eeab22170dda2 100644 (file)
@@ -3,16 +3,16 @@
 
 package isatty
 
-import (
-       "syscall"
-       "unsafe"
-)
-
-const ioctlReadTermios = syscall.TCGETS
+import "golang.org/x/sys/unix"
 
 // IsTerminal return true if the file descriptor is terminal.
 func IsTerminal(fd uintptr) bool {
-       var termios syscall.Termios
-       _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
-       return err == 0
+       _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
+       return err == nil
+}
+
+// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
+// terminal. This is also always false on this environment.
+func IsCygwinTerminal(fd uintptr) bool {
+       return false
 }