statsd_exporter/vendor/github.com/Sirupsen/logrus/terminal_solaris.go
Johannes 'fish' Ziemke a78a6d2635 Vendor dependencies
2016-05-03 19:25:23 +02:00

15 lines
262 B
Go

// +build solaris
package logrus
import (
"os"
"golang.org/x/sys/unix"
)
// IsTerminal returns true if the given file descriptor is a terminal.
func IsTerminal() bool {
_, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
return err == nil
}