mirror of
https://github.com/nwtgck/handy-sshd.git
synced 2025-07-25 07:18:48 +00:00
fix: wait non-nil process
This commit is contained in:
parent
f41ff25604
commit
f6d96d1a78
1 changed files with 5 additions and 3 deletions
|
@ -31,9 +31,11 @@ func (s *Server) createPty(shell string, connection ssh.Channel) (*os.File, erro
|
||||||
Status: 0,
|
Status: 0,
|
||||||
}))
|
}))
|
||||||
connection.Close()
|
connection.Close()
|
||||||
_, err := sh.Process.Wait()
|
if sh.Process != nil {
|
||||||
if err != nil {
|
_, err := sh.Process.Wait()
|
||||||
s.Logger.Info("failed to exit shell", err)
|
if err != nil {
|
||||||
|
s.Logger.Info("failed to exit shell", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s.Logger.Info("session closed")
|
s.Logger.Info("session closed")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue