Remove dependency on golang.org/x/sys/unix

(*os.PathError).Timeout does the same thing.

PiperOrigin-RevId: 360756784
This commit is contained in:
Tamir Duberstein
2021-03-03 14:26:30 -08:00
committed by gVisor bot
parent 9c80bcf32d
commit cfd2c31962
2 changed files with 1 additions and 3 deletions
-1
View File
@@ -18,7 +18,6 @@ go_library(
deps = [
"//pkg/linewriter",
"//pkg/sync",
"@org_golang_x_sys//unix:go_default_library",
],
)
+1 -2
View File
@@ -40,7 +40,6 @@ import (
"sync/atomic"
"time"
"golang.org/x/sys/unix"
"gvisor.dev/gvisor/pkg/linewriter"
"gvisor.dev/gvisor/pkg/sync"
)
@@ -105,7 +104,7 @@ func (l *Writer) Write(data []byte) (int, error) {
n += w
// Is it a non-blocking socket?
if pathErr, ok := err.(*os.PathError); ok && pathErr.Err == unix.EAGAIN {
if pathErr, ok := err.(*os.PathError); ok && pathErr.Timeout() {
runtime.Gosched()
continue
}