Browse Source

http2/h2i: do not assume that stdin value is always 0

Fixes golang/go#17661

Change-Id: Iff004af969c694dde9bc3c56add3a419ab1beac7
Reviewed-on: https://go-review.googlesource.com/32373
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Alex Brainman 9 years ago
parent
commit
4cfeeeb61a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      http2/h2i/h2i.go

+ 1 - 1
http2/h2i/h2i.go

@@ -168,7 +168,7 @@ func (app *h2i) Main() error {
 
 	app.framer = http2.NewFramer(tc, tc)
 
-	oldState, err := terminal.MakeRaw(0)
+	oldState, err := terminal.MakeRaw(int(os.Stdin.Fd()))
 	if err != nil {
 		return err
 	}