Browse Source

go.crypto/ssh: More error reporting improvements.

R=golang-dev, kardianos, dave
CC=golang-dev
https://golang.org/cl/8596047
David Symonds 12 years ago
parent
commit
ac9976b0b7
2 changed files with 4 additions and 4 deletions
  1. 1 1
      ssh/client.go
  2. 3 3
      ssh/test/test_unix_test.go

+ 1 - 1
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

+ 3 - 3
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() {