os: move epipecheck from file_posix.go and into file_unix.go to fix windows build

R=golang-dev
CC=golang-dev
https://golang.org/cl/6450058
This commit is contained in:
Alex Brainman 2012-07-27 22:21:33 +10:00
parent ab9ccedefe
commit 9c8ae6ca34
3 changed files with 14 additions and 11 deletions

View file

@ -8,6 +8,7 @@ package os
import (
"runtime"
"sync/atomic"
"syscall"
)
@ -53,6 +54,16 @@ type dirInfo struct {
bufp int // location of next record in buf.
}
func epipecheck(file *File, e error) {
if e == syscall.EPIPE {
if atomic.AddInt32(&file.nepipe, 1) >= 10 {
sigpipe()
}
} else {
atomic.StoreInt32(&file.nepipe, 0)
}
}
// DevNull is the name of the operating system's ``null device.''
// On Unix-like systems, it is "/dev/null"; on Windows, "NUL".
const DevNull = "/dev/null"