Skip to content

Commit

Permalink
fix init on windows failed (#34)
Browse files Browse the repository at this point in the history
The failure is due to /dev/null is not existed on windows.
  • Loading branch information
winglq authored Nov 13, 2024
1 parent 6f79eb4 commit ee25178
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions splice/splice.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io/ioutil"
"log"
"os"
"runtime"
"syscall"
)

Expand All @@ -34,6 +35,9 @@ const DefaultPipeSize = 16 * 4096
var devNullFD uintptr

func init() {
if runtime.GOOS != "linux" {
return
}
content, err := ioutil.ReadFile("/proc/sys/fs/pipe-max-size")
if err != nil {
maxPipeSize = DefaultPipeSize
Expand Down

0 comments on commit ee25178

Please sign in to comment.