From ac9976b0b777e245f8d604b85443ae50f1514d04 Mon Sep 17 00:00:00 2001 From: David Symonds Date: Fri, 26 Apr 2013 09:44:04 +1000 Subject: [PATCH] go.crypto/ssh: More error reporting improvements. R=golang-dev, kardianos, dave CC=golang-dev https://golang.org/cl/8596047 --- ssh/client.go | 2 +- ssh/test/test_unix_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ssh/client.go b/ssh/client.go index e2a143e..72b01ab 100644 --- a/ssh/client.go +++ b/ssh/client.go @@ -42,7 +42,7 @@ func Client(c net.Conn, config *ClientConfig) (*ClientConn, error) { } if err := conn.handshake(); err != nil { conn.Close() - return nil, err + return nil, fmt.Errorf("handshake failed: %v", err) } go conn.mainLoop() return conn, nil diff --git a/ssh/test/test_unix_test.go b/ssh/test/test_unix_test.go index 22a7691..be0f0ef 100644 --- a/ssh/test/test_unix_test.go +++ b/ssh/test/test_unix_test.go @@ -129,9 +129,9 @@ func (s *server) Dial(config *ssh.ClientConfig) *ssh.ClientConn { func (s *server) Shutdown() { if s.cmd != nil && s.cmd.Process != nil { - if err := s.cmd.Process.Kill(); err != nil { - s.t.Error(err) - } + // don't check for Kill error; if it fails it's most likely + // "os: process already finished", and we don't care about that. + s.cmd.Process.Kill() s.cmd.Wait() } if s.t.Failed() {