Explorar o código

tsshd: fix double exit with different exit codes

Signed-off-by: Joonas Loppi <[email protected]>
Joonas Loppi %!s(int64=4) %!d(string=hai) anos
pai
achega
a3b709f0c4
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      cmd/tsshd/tsshd.go

+ 2 - 1
cmd/tsshd/tsshd.go

@@ -157,8 +157,9 @@ func handleSSH(s ssh.Session) {
 		cmd.Process.Kill()
 		if err := cmd.Wait(); err != nil {
 			s.Exit(1)
+		} else {
+			s.Exit(0)
 		}
-		s.Exit(0)
 		return
 	}