diff --git a/protocols/client/client.go b/protocols/client/client.go index 7e8953ea2..e46e87390 100644 --- a/protocols/client/client.go +++ b/protocols/client/client.go @@ -9,7 +9,6 @@ package client import ( "context" "fmt" - "io" "net" "net/url" "strconv" @@ -419,11 +418,8 @@ func HybridVSockDialer(sock string, timeout time.Duration) (net.Conn, error) { return nil, err } eot := make([]byte, 1) - if n, _, err := unix.Recvfrom(int(file.Fd()), eot, syscall.MSG_PEEK); err != nil || n == 0 { + if _, _, err = unix.Recvfrom(int(file.Fd()), eot, syscall.MSG_PEEK); err != nil { conn.Close() - if err == nil { - err = io.EOF - } return nil, err } }