]> git.ipfire.org Git - thirdparty/systemd.git/commit
ptyfwd,run: process remaining outputs in IO event sources
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 25 Dec 2024 08:40:04 +0000 (17:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 25 Dec 2024 08:50:15 +0000 (17:50 +0900)
commit7647378b74a3a701bfcfea69e5b8514f32efad4b
treecf0145eabd5ca53d60bffcbaa0dfc35bade3dc3c
parentbb4244f4548c378b2bbccd2421ac76ef2d7ad168
ptyfwd,run: process remaining outputs in IO event sources

This partially reverts 12807b5a49d1fe60434d473afe11ff81a4c92306.

Otherwise, reading or writing a fd in on_exit_event() handler may return
EBUSY, and the event loop may finish with -ELOOP.

Also, this makes drained() returns true if the PTY forwarder is already
disconnected, for safety. Hence, it is not necessary to re-introduce
pty_forward_is_done().
src/run/run.c
src/shared/ptyfwd.c
src/shared/ptyfwd.h