From 81cb4810f79f615b3abc4979709ca3fcbc78fa89 Mon Sep 17 00:00:00 2001 From: arturfabriciohahaedgy Date: Sat, 31 Dec 2022 11:29:53 -0300 Subject: [PATCH] fix change in return value of syscall.Open(extstart in unix.go) --- cmd/samterm/sys.go | 5 +++-- cmd/samterm/unix.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) 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