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 b823809bca and
cf89e48028.
This commit is contained in:
Yu Watanabe
2025-08-18 13:05:12 +01:00
committed by Luca Boccassi
parent b5be05a106
commit 73c4350fda
+1 -1
View File
@@ -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;