From c1b61542d78094ef1a6fee0746528a251730141f Mon Sep 17 00:00:00 2001 From: David Bariod Date: Wed, 3 Apr 2019 10:46:44 +0200 Subject: [PATCH] Fix solaris build --- terminal_check_solaris.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 terminal_check_solaris.go diff --git a/terminal_check_solaris.go b/terminal_check_solaris.go new file mode 100644 index 0000000..f6710b3 --- /dev/null +++ b/terminal_check_solaris.go @@ -0,0 +1,11 @@ +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 +}