Skip to content

Commit

Permalink
kqueue: close closepipe on error
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Mar 5, 2016
1 parent baf2550 commit cb591dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kqueue.go
Expand Up @@ -469,6 +469,8 @@ func kqueue() (kq int, closepipe [2]int, err error) {
syscall.SetKevent(&events[0], closepipe[0], syscall.EVFILT_READ, pflag)
if ok, err := syscall.Kevent(kq, events, nil, nil); ok == -1 {
syscall.Close(kq)
syscall.Close(closepipe[0])
syscall.Close(closepipe[1])
return kq, closepipe, err
}
return kq, closepipe, nil
Expand Down

0 comments on commit cb591dd

Please sign in to comment.