summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-13 00:55:10 +0200
committerGitHub <noreply@github.com>2019-09-13 00:55:10 +0200
commitb095d8a794edaab3b2d622b6882bfd57fad8375e (patch)
tree84a2a6c1059ffeae89764d5e9bac56bcc6d99088 /libpod
parentb43a36d7a3974a27eab7c73e5e0dd1a107bac95d (diff)
parent1dcb771dbd63e7ee883e400da4a8e3295cfb6666 (diff)
downloadpodman-b095d8a794edaab3b2d622b6882bfd57fad8375e.tar.gz
podman-b095d8a794edaab3b2d622b6882bfd57fad8375e.tar.bz2
podman-b095d8a794edaab3b2d622b6882bfd57fad8375e.zip
Merge pull request #4010 from haircommander/regsiter-later
exec: Register resize func a bit later
Diffstat (limited to 'libpod')
-rw-r--r--libpod/oci_attach_linux.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/libpod/oci_attach_linux.go b/libpod/oci_attach_linux.go
index 22afa7416..6cada0801 100644
--- a/libpod/oci_attach_linux.go
+++ b/libpod/oci_attach_linux.go
@@ -107,8 +107,6 @@ func (c *Container) attachToExec(streams *AttachStreams, keys string, resize <-c
logrus.Debugf("Attaching to container %s exec session %s", c.ID(), sessionID)
- registerResizeFunc(resize, c.execBundlePath(sessionID))
-
// set up the socket path, such that it is the correct length and location for exec
socketPath := buildSocketPath(c.execAttachSocketPath(sessionID))
@@ -116,6 +114,7 @@ func (c *Container) attachToExec(streams *AttachStreams, keys string, resize <-c
if _, err := readConmonPipeData(attachFd, ""); err != nil {
return err
}
+
// 2: then attach
conn, err := net.DialUnix("unixpacket", nil, &net.UnixAddr{Name: socketPath, Net: "unixpacket"})
if err != nil {
@@ -127,6 +126,10 @@ func (c *Container) attachToExec(streams *AttachStreams, keys string, resize <-c
}
}()
+ // Register the resize func after we've read the attach socket, as we know at this point the
+ // 'ctl' file has been created in conmon
+ registerResizeFunc(resize, c.execBundlePath(sessionID))
+
// start listening on stdio of the process
receiveStdoutError, stdinDone := setupStdioChannels(streams, conn, detachKeys)