summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-12-19 04:22:00 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-12-20 00:59:41 +0100
commitcf89e48028ed3b651f63ba624175394c3c0d8efa (patch)
tree2597df6561ef880ffabd19711efdffb4f75f639e /src
parentmachine: make TEST-13-NSPAWN wqlong-running code more verbose (diff)
downloadsystemd-cf89e48028ed3b651f63ba624175394c3c0d8efa.tar.xz
systemd-cf89e48028ed3b651f63ba624175394c3c0d8efa.zip
ptyfwd: reset writable/readable flag before shovel() on exit
Follow-up for 12807b5a49d1fe60434d473afe11ff81a4c92306. Otherwise, if a call of shovel() disabled the flags, the subsequent calls do nothing even if there is something we need to read or write. Fixes the following error: ``` Dec 19 02:19:39 run0[5618]: Error on PTY forwarding logic: Too many levels of symbolic links ```
Diffstat (limited to '')
-rw-r--r--src/shared/ptyfwd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c
index ea36530041..f0b45dd918 100644
--- a/src/shared/ptyfwd.c
+++ b/src/shared/ptyfwd.c
@@ -840,6 +840,13 @@ static int on_exit_event(sd_event_source *e, void *userdata) {
if (drained(f))
return pty_forward_done(f, 0);
+ if (!f->master_hangup)
+ f->master_writable = f->master_readable = true;
+ if (!f->stdin_hangup)
+ f->stdin_readable = true;
+ if (!f->stdout_hangup)
+ f->stdout_writable = true;
+
r = shovel(f);
if (r < 0)
return r;