aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2022-05-04 14:57:01 +0200
committerMatthew Heon <matthew.heon@pm.me>2022-05-05 15:44:50 -0400
commit7b64cd7835f1bacd326096fc5e41d44957a79230 (patch)
tree8ee88d9ad02e0c1a246be771abc956b2ba426a1d /libpod
parent6d1d6cc0b20eeb96169d7ec5d10a152f765773e9 (diff)
downloadpodman-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>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/oci_attach_linux.go3
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 {