From 73c4350fdae90a0f2988d0733c10f30b74cadf5b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 18 Aug 2025 15:46:04 +0900 Subject: [PATCH] ptyfwd: do not try to read from PTYForward.input_fd when read-only mode Fixes the following error message (the last line): ``` [FAILED] Failed to start TEST-60-MOUNT-RATELIMIT.service. Sending SIGTERM to remaining processes... Sending SIGKILL to remaining processes... All filesystems, swaps, loop devices, MD devices and DM devices detached. Exiting container. Failed to read from pty input fd: Bad file descriptor ``` Follow-up for b823809bca6cd531a54fcf0f02427aea7cd3e651 and cf89e48028ed3b651f63ba624175394c3c0d8efa. --- src/shared/ptyfwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c index 2b1154f5fa1..46151ee21b9 100644 --- a/src/shared/ptyfwd.c +++ b/src/shared/ptyfwd.c @@ -810,7 +810,7 @@ static int shovel_force(PTYForward *f) { if (!f->master_hangup) f->master_writable = f->master_readable = true; - if (!f->stdin_hangup) + if (!f->stdin_hangup && f->input_fd >= 0) f->stdin_readable = true; if (!f->stdout_hangup) f->stdout_writable = true; -- 2.47.3