From 1c93da5ded1b80338ae4014084ce005f89e20a94 Mon Sep 17 00:00:00 2001
From: Shiming Zhang <wzshiming@foxmail.com>
Date: Mon, 31 Oct 2022 17:18:27 +0800
Subject: [PATCH] Fix missing closed fifo

Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
---
 runtime/v1/shim/service_linux.go | 1 +
 runtime/v2/runc/service_linux.go | 1 +
 2 files changed, 2 insertions(+)

diff --git a/runtime/v1/shim/service_linux.go b/runtime/v1/shim/service_linux.go
index 307e20d..b8b85f6 100644
--- a/runtime/v1/shim/service_linux.go
+++ b/runtime/v1/shim/service_linux.go
@@ -54,6 +54,7 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console
 			io.CopyBuffer(epollConsole, in, *bp)
 			// we need to shutdown epollConsole when pipe broken
 			epollConsole.Shutdown(p.epoller.CloseConsole)
+			in.Close()
 		}()
 	}
 
diff --git a/runtime/v2/runc/service_linux.go b/runtime/v2/runc/service_linux.go
index 195c230..de85993 100644
--- a/runtime/v2/runc/service_linux.go
+++ b/runtime/v2/runc/service_linux.go
@@ -54,6 +54,7 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console
 			io.CopyBuffer(epollConsole, in, *bp)
 			// we need to shutdown epollConsole when pipe broken
 			epollConsole.Shutdown(p.epoller.CloseConsole)
+			in.Close()
 		}()
 	}
 
-- 
2.33.0

