Skip to content

Commit

Permalink
Merge branch 'master' into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHines committed May 14, 2015
2 parents f4b937f + ee210fc commit dc7890a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
14 changes: 14 additions & 0 deletions ext/handler.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ext

import (
"os"
"sync"
"sync/atomic"
"unsafe"
Expand Down Expand Up @@ -114,3 +115,16 @@ func (h *HotSwap) Log(r *log.Record) error {
func (h *HotSwap) Swap(newHandler log.Handler) {
atomic.StorePointer(&h.handler, unsafe.Pointer(&newHandler))
}

// FatalHandler makes critical errors exit the program
// immediately, much like the log.Fatal* methods from the
// standard log package
func FatalHandler(h log.Handler) log.Handler {
return log.FuncHandler(func(r *log.Record) error {
err := h.Log(r)
if r.Lvl == log.LvlCrit {
os.Exit(1)
}
return err
})
}
2 changes: 1 addition & 1 deletion term/terminal_notwindows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,!appengine darwin freebsd
// +build linux,!appengine darwin freebsd openbsd

package term

Expand Down
7 changes: 7 additions & 0 deletions term/terminal_openbsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package term

import "syscall"

const ioctlReadTermios = syscall.TIOCGETA

type Termios syscall.Termios

0 comments on commit dc7890a

Please sign in to comment.