ptyfwd: reset writable/readable flag before shovel() on exit

Follow-up for 12807b5a49.

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
```
This commit is contained in:
Yu Watanabe
2024-12-20 08:59:41 +09:00
parent 3cbf00a30c
commit cf89e48028
+7
View File
@@ -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;