From 7dcaeaf3220109910515ec208b7ed6db4e8435a2 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 2 Dec 2018 13:23:51 +0000 Subject: vm/gce: close old consolew in Run Run can be executed several times on a VM. --- vm/gce/gce.go | 3 +++ vm/vmimpl/openbsd.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/vm/gce/gce.go b/vm/gce/gce.go index 4c3708ad5..d2ce480ff 100644 --- a/vm/gce/gce.go +++ b/vm/gce/gce.go @@ -228,6 +228,9 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin conWpipe.Close() return nil, nil, err } + if inst.consolew != nil { + inst.consolew.Close() + } inst.consolew = conw if err := con.Start(); err != nil { conRpipe.Close() diff --git a/vm/vmimpl/openbsd.go b/vm/vmimpl/openbsd.go index 79132ebf8..221e1e4db 100644 --- a/vm/vmimpl/openbsd.go +++ b/vm/vmimpl/openbsd.go @@ -1,3 +1,6 @@ +// Copyright 2018 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + package vmimpl import ( -- cgit mrf-deployment