go.crypto/ssh: More error reporting improvements.
R=golang-dev, kardianos, dave CC=golang-dev https://golang.org/cl/8596047
This commit is contained in:
Родитель
41998200eb
Коммит
ac9976b0b7
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче