Merge pull request #289 from 0xE0F/crosscompiling-solaris

Cross compiling for Solaris-like OS
This commit is contained in:
Simon Eskildsen 2015-11-17 10:41:36 +01:00
commit a22723f16e
1 changed files with 15 additions and 0 deletions

15
terminal_solaris.go Normal file
View File

@ -0,0 +1,15 @@
// +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
}