Skip to content

Commit

Permalink
Merge pull request #289 from 0xE0F/crosscompiling-solaris
Browse files Browse the repository at this point in the history
Cross compiling for Solaris-like OS
  • Loading branch information
sirupsen committed Nov 17, 2015
2 parents ba3ef66 + 8cdd4b3 commit a22723f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions terminal_solaris.go
@@ -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
}

0 comments on commit a22723f

Please sign in to comment.