1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/vendor/github.com/sirupsen/logrus/terminal_check_solaris.go
Sebastiaan van Stijn 9fac44028e
bump logrus v1.4.2
full diff: https://github.com/sirupsen/logrus/compare/v1.4.1...v1.4.2

- sirupsen/logrus#946 Fix solaris build
- sirupsen/logrus#966 Add a checkTerminal for nacl to support running on play.golang.org
- sirupsen/logrus#969 fix build break for plan9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-06 02:16:47 +02:00

11 lines
224 B
Go

package logrus
import (
"golang.org/x/sys/unix"
)
// IsTerminal returns true if the given file descriptor is a terminal.
func isTerminal(fd int) bool {
_, err := unix.IoctlGetTermio(fd, unix.TCGETA)
return err == nil
}