diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2022-05-04 14:57:01 +0200 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2022-05-05 15:44:50 -0400 |
commit | 7b64cd7835f1bacd326096fc5e41d44957a79230 (patch) | |
tree | 8ee88d9ad02e0c1a246be771abc956b2ba426a1d | |
parent | 6d1d6cc0b20eeb96169d7ec5d10a152f765773e9 (diff) | |
download | podman-7b64cd7835f1bacd326096fc5e41d44957a79230.tar.gz podman-7b64cd7835f1bacd326096fc5e41d44957a79230.tar.bz2 podman-7b64cd7835f1bacd326096fc5e41d44957a79230.zip |
libpod: treat ECONNRESET as EOF
when reading from the attach socket, treat ECONNRESET in the same way
as EOF.
[NO NEW TESTS NEEDED]
Closes: https://github.com/containers/podman/issues/11446
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r-- | libpod/oci_attach_linux.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libpod/oci_attach_linux.go b/libpod/oci_attach_linux.go index c6af294d5..06f8f8719 100644 --- a/libpod/oci_attach_linux.go +++ b/libpod/oci_attach_linux.go @@ -9,6 +9,7 @@ import ( "net" "os" "path/filepath" + "syscall" "github.com/containers/common/pkg/config" "github.com/containers/podman/v4/libpod/define" @@ -259,7 +260,7 @@ func redirectResponseToOutputStreams(outputStream, errorStream io.Writer, writeO } } } - if er == io.EOF { + if errors.Is(er, io.EOF) || errors.Is(er, syscall.ECONNRESET) { break } if er != nil { |