diff --git a/cmd/samterm/sys.go b/cmd/samterm/sys.go index 0af6e62..822698c 100644 --- a/cmd/samterm/sys.go +++ b/cmd/samterm/sys.go @@ -8,6 +8,7 @@ import ( "log" "os" "strconv" + "syscall" "9fans.net/go/draw" "9fans.net/go/plan9" @@ -77,10 +78,10 @@ func removeextern() { os.Remove(exname) } -func extproc(c chan string, fd *os.File) { +func extproc(c chan string, fd int) { buf := make([]byte, READBUFSIZE) for { - n, err := fd.Read(buf) + n, err := syscall.Read(fd, buf) if err != nil { fmt.Fprintf(os.Stderr, "samterm: extern read error: %v\n", err) return /* not a fatal error */ diff --git a/cmd/samterm/unix.go b/cmd/samterm/unix.go index b9aea5a..a6ca8a8 100644 --- a/cmd/samterm/unix.go +++ b/cmd/samterm/unix.go @@ -1,3 +1,4 @@ +//go:build unix // +build unix package main