Skip to content

Commit a22723f

Browse files
committed
Merge pull request #289 from 0xE0F/crosscompiling-solaris
Cross compiling for Solaris-like OS
2 parents ba3ef66 + 8cdd4b3 commit a22723f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

terminal_solaris.go

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// +build solaris
2+
3+
package logrus
4+
5+
import (
6+
"os"
7+
8+
"golang.org/x/sys/unix"
9+
)
10+
11+
// IsTerminal returns true if the given file descriptor is a terminal.
12+
func IsTerminal() bool {
13+
_, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
14+
return err == nil
15+
}

0 commit comments

Comments
 (0)