projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8439ad9
)
17170: Fix closing pty/tty when nil.
author
Tom Clegg <tom@curii.com>
Thu, 14 Jan 2021 04:22:51 +0000
(23:22 -0500)
committer
Tom Clegg <tom@curii.com>
Thu, 14 Jan 2021 04:27:58 +0000
(23:27 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>
lib/crunchrun/container_gateway.go
patch
|
blob
|
history
diff --git
a/lib/crunchrun/container_gateway.go
b/lib/crunchrun/container_gateway.go
index 8b2fe4144059d03293129631f02a3738d0eb83fc..0d869ca7fc750f4969c5f423245dc1c860124b7d 100644
(file)
--- a/
lib/crunchrun/container_gateway.go
+++ b/
lib/crunchrun/container_gateway.go
@@
-204,8
+204,6
@@
func (gw *Gateway) handleSSH(w http.ResponseWriter, req *http.Request) {
}
var pty0, tty0 *os.File
go func() {
- defer pty0.Close()
- defer tty0.Close()
// Where to send errors/messages for the
// client to see
logw := io.Writer(ch.Stderr())
@@
-280,6
+278,8
@@
func (gw *Gateway) handleSSH(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(ch.Stderr(), "pty failed: %s"+eol, err)
break
}
+ defer p.Close()
+ defer t.Close()
pty0, tty0 = p, t
ok = true
var payload struct {