Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion init.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,19 @@ func minimalInit(sys syscaller, args []string) error {
fmt.Fprintf(stdio, "%s is not readable, execution might fail with %q\n", cmd.Path, err)
}

result := proc.Run()
result := proc.Start()
if result == nil {
// Work around a bug in virtio-console which doesn't deal well with concurrent
// access to a single serial port.
//
// It is crucial that we don't hold on to stdio, otherwise the runtime will
// opportunistically poll it, which causes writes to hang.
//
// See https://github.com/lmb/vimto/issues/29.
_ = stdio.Close()

result = proc.Wait()
}

if err := executeSimpleCommands(cmd.Teardown, cmd.Dir, cmd.Env); err != nil {
return fmt.Errorf("teardown: %w", err)
Expand Down