From cfd2c31962a4358d7d05a4bd04dde271dc238339 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Wed, 3 Mar 2021 14:23:59 -0800 Subject: Remove dependency on golang.org/x/sys/unix (*os.PathError).Timeout does the same thing. PiperOrigin-RevId: 360756784 --- pkg/log/BUILD | 1 - pkg/log/log.go | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/log/BUILD b/pkg/log/BUILD index 23ef7ea8d..3ed6aba5c 100644 --- a/pkg/log/BUILD +++ b/pkg/log/BUILD @@ -18,7 +18,6 @@ go_library( deps = [ "//pkg/linewriter", "//pkg/sync", - "@org_golang_x_sys//unix:go_default_library", ], ) diff --git a/pkg/log/log.go b/pkg/log/log.go index d39af3bf4..073cf6238 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -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 } -- cgit v1.2.3