diff options
author | 2018-01-04 08:44:00 +0000 | |
---|---|---|
committer | 2018-01-04 08:44:00 +0000 | |
commit | 35fd2cc86d442dee6fa4c8adb46a6e4906a66ab3 (patch) | |
tree | cf5c057ee0aeb769c683368f1f391dacafd1d671 /vendor/github.com/sirupsen/logrus/terminal_solaris.go | |
parent | 8b44355205182f6042b0691fa31fb8aafcefb42d (diff) | |
parent | ac6019137d5b10d02c7acac4f63fa22091b9933d (diff) |
Merge "Fix imports for github.com/sirupsen/logrus"
Diffstat (limited to 'vendor/github.com/sirupsen/logrus/terminal_solaris.go')
-rw-r--r-- | vendor/github.com/sirupsen/logrus/terminal_solaris.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/github.com/sirupsen/logrus/terminal_solaris.go b/vendor/github.com/sirupsen/logrus/terminal_solaris.go new file mode 100644 index 0000000..3c86b1a --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/terminal_solaris.go @@ -0,0 +1,21 @@ +// +build solaris,!appengine + +package logrus + +import ( + "io" + "os" + + "golang.org/x/sys/unix" +) + +// IsTerminal returns true if the given file descriptor is a terminal. +func IsTerminal(f io.Writer) bool { + switch v := f.(type) { + case *os.File: + _, err := unix.IoctlGetTermios(int(v.Fd()), unix.TCGETA) + return err == nil + default: + return false + } +} |