mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
console.ClearONLCR: move it back
This reverts most of commit 24c05b7, as otherwise it causes
a few regressions (docker cli, TestDockerSwarmSuite/TestServiceLogsTTY).
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -106,6 +106,9 @@ func handleSingle(path string, noStdin bool) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := console.ClearONLCR(c.Fd()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Copy from our stdio to the master fd.
|
||||
var (
|
||||
|
||||
@@ -186,10 +186,6 @@ func setupConsole(socket *os.File, config *initConfig, mount bool) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = console.ClearONLCR(pty.Fd())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// After we return from here, we don't need the console anymore.
|
||||
defer pty.Close()
|
||||
|
||||
@@ -313,6 +313,11 @@ func TestExecInTTY(t *testing.T) {
|
||||
done <- fmt.Errorf("ConsoleFromFile: %w", err)
|
||||
return
|
||||
}
|
||||
err = console.ClearONLCR(c.Fd())
|
||||
if err != nil {
|
||||
done <- fmt.Errorf("ClearONLCR: %w", err)
|
||||
return
|
||||
}
|
||||
// An error from io.Copy is expected once the terminal
|
||||
// is gone, so we deliberately ignore it.
|
||||
_, _ = io.Copy(&stdout, c)
|
||||
|
||||
Reference in New Issue
Block a user