summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers_remote.go
diff options
context:
space:
mode:
authorPeter Hunt <pehunt@redhat.com>2019-07-23 11:47:36 -0400
committerPeter Hunt <pehunt@redhat.com>2019-07-23 13:30:15 -0400
commitd59f083637f267b3653bc7cda46fd729dcf35c17 (patch)
tree5c4d9b19524d0d2a968611de1ec69d20ddcbd77d /pkg/adapter/containers_remote.go
parent9e6928570459ba5451f2128a9391bbb48acefc1e (diff)
downloadpodman-d59f083637f267b3653bc7cda46fd729dcf35c17.tar.gz
podman-d59f083637f267b3653bc7cda46fd729dcf35c17.tar.bz2
podman-d59f083637f267b3653bc7cda46fd729dcf35c17.zip
always send generic error in case io fails
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'pkg/adapter/containers_remote.go')
-rw-r--r--pkg/adapter/containers_remote.go10
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
+ }
+}