]> Cypherpunks repositories - gostls13.git/commitdiff
os: move epipecheck from file_posix.go and into file_unix.go to fix windows build
authorAlex Brainman <alex.brainman@gmail.com>
Fri, 27 Jul 2012 12:21:33 +0000 (22:21 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Fri, 27 Jul 2012 12:21:33 +0000 (22:21 +1000)
R=golang-dev
CC=golang-dev
https://golang.org/cl/6450058

src/pkg/os/file_posix.go
src/pkg/os/file_unix.go
src/pkg/os/file_windows.go

index ea42cc67b5128ef2b431dd6322bb453e6dfb1164..1ba32931541efa8a01b919f4ae77700babe7d17d 100644 (file)
@@ -7,23 +7,12 @@
 package os
 
 import (
-       "sync/atomic"
        "syscall"
        "time"
 )
 
 func sigpipe() // implemented in package runtime
 
-func epipecheck(file *File, e error) {
-       if e == syscall.EPIPE {
-               if atomic.AddInt32(&file.nepipe, 1) >= 10 {
-                       sigpipe()
-               }
-       } else {
-               atomic.StoreInt32(&file.nepipe, 0)
-       }
-}
-
 // Link creates newname as a hard link to the oldname file.
 // If there is an error, it will be of type *LinkError.
 func Link(oldname, newname string) error {
index 12daa70a760c75df5953fc3c8e2a6b52298645de..5a220f66a7653a2341c373ae9c4d54f2ad59946e 100644 (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"
index 320ee22518c5ec225a5f6c6edffbd94ed5d0608f..6c2bc6639c6235d1135b84d2272c55e9f6b1ab30 100644 (file)
@@ -54,6 +54,9 @@ type dirInfo struct {
        path     string
 }
 
+func epipecheck(file *File, e error) {
+}
+
 const DevNull = "NUL"
 
 func (f *file) isdir() bool { return f != nil && f.dirinfo != nil }