diff options
Diffstat (limited to 'pkg/adapter')
-rw-r--r-- | pkg/adapter/containers_remote.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/adapter/containers_remote.go b/pkg/adapter/containers_remote.go index 751c184b3..b7390c113 100644 --- a/pkg/adapter/containers_remote.go +++ b/pkg/adapter/containers_remote.go @@ -1073,6 +1073,7 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std // Read from the wire and direct to stdout or stderr err := virtwriter.Reader(reader, stdout, os.Stderr, nil, nil, ecChan) defer restoreTerminal(oldTermState) + sendGenericError(ecChan) errChan <- err }() @@ -1081,11 +1082,13 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std b, err := json.Marshal(termResize) if err != nil { defer restoreTerminal(oldTermState) + sendGenericError(ecChan) errChan <- err } _, err = varlinkResizeWriter.Write(b) if err != nil { defer restoreTerminal(oldTermState) + sendGenericError(ecChan) errChan <- err } } @@ -1096,6 +1099,7 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std go func() { if _, err := io.Copy(varlinkStdinWriter, stdin); err != nil { defer restoreTerminal(oldTermState) + sendGenericError(ecChan) errChan <- err } @@ -1103,3 +1107,9 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std } return errChan } + +func sendGenericError(ecChan chan int) { + if ecChan != nil { + ecChan <- define.ExecErrorCodeGeneric + } +} |