From: Yu Watanabe Date: Mon, 18 Aug 2025 06:46:04 +0000 (+0900) Subject: ptyfwd: do not try to read from PTYForward.input_fd when read-only mode X-Git-Tag: v258-rc3~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73c4350fdae90a0f2988d0733c10f30b74cadf5b;p=thirdparty%2Fsystemd.git 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. --- 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;