Add support for DragonflyBSD and NetBSD.

This merges all the bsd (including darwin) support into terminal_bsd.go

Cross-compiling works for all of them in that they all compile, but I've only
actually tested the binary on dragonflybsd.  I don't see why this wouldn't
work on the others since I don't think they'd compile if they didn't
support TIOCGETA and Termios, but just a heads up.
This commit is contained in:
Curtis Gagliardi 2015-06-26 12:27:29 -07:00
parent 93a1736895
commit 8a5c13cf78
4 changed files with 3 additions and 33 deletions

View File

@ -1,3 +1,5 @@
// +build darwin freebsd openbsd netbsd dragonfly
package logrus
import "syscall"

View File

@ -1,12 +0,0 @@
// Based on ssh/terminal:
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package logrus
import "syscall"
const ioctlReadTermios = syscall.TIOCGETA
type Termios syscall.Termios

View File

@ -1,20 +0,0 @@
/*
Go 1.2 doesn't include Termios for FreeBSD. This should be added in 1.3 and this could be merged with terminal_darwin.
*/
package logrus
import (
"syscall"
)
const ioctlReadTermios = syscall.TIOCGETA
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Cc [20]uint8
Ispeed uint32
Ospeed uint32
}

View File

@ -3,7 +3,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux darwin freebsd openbsd
// +build linux darwin freebsd openbsd netbsd dragonfly
package logrus