]> git.ipfire.org Git - thirdparty/systemd.git/commit
ptyfwd: before deciding that a pty is fully drained, ask the kernel again
authorLennart Poettering <lennart@poettering.net>
Tue, 5 Dec 2017 17:28:56 +0000 (18:28 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Dec 2017 17:33:24 +0000 (18:33 +0100)
commite22e69a31edd3089514436174f97d4d8d96ed194
tree547321289e100a09a5b46f8540c073d514b8b4c6
parent3aa6a559040dda5f5db061d77ef5c5aaf3b33501
ptyfwd: before deciding that a pty is fully drained, ask the kernel again

Apparently there's no guarantee that EPOLLIN is immediately propagated
from a pty slave to the master when data is written to it, hence it's
not sufficient to check EPOLLIN to decide whether the pty device is
drained.

Let's fix this by asking the kernel directly through SIOCINQ + SIOCOUTQ,
if there's anything buffered left.

Fixes: #7531
src/shared/ptyfwd.c