diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-06-05 10:34:16 +1000 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-06-05 09:46:52 +0200 |
| commit | 21f4d13c4cd4db24b65926265c98d5f41f0c6a9b (patch) | |
| tree | 626b588bbfa5081430a4d71283b5dc225f93389a /contrib/qemu | |
| parent | 31d0893d47e3d147b3a1597bbede7de65281a62f (diff) | |
| download | passt-master.tar passt-master.tar.gz passt-master.tar.bz2 passt-master.tar.lz passt-master.tar.xz passt-master.tar.zst passt-master.zip | |
At the end of our loop we have a conditional 'break' that exits if we're
at EOF on the read side and have nothing left in the pipe. This makes
sense: at EOF there's nothing left to do read-side and with nothing in the
pipe there's nothing to do write side either.
The same is true if the read side hit an EAGAIN and the pipe is empty:
there's nothing we can do (for now) read side, and with an empty pipe
nothing write side either. So, generalise the condition to exit on either
EOF or EAGAIN read side.
Furthermore, if the read side is at EOF or EAGAIN and there's already
nothing in the pipe before the write-side splice(), then that write side
splice() can't accomplish anything, so exit the loop early in that case
avoiding a harmless but unnecessary write-splice().
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
[sbrivio: Minor comment fix]
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'contrib/qemu')
0 files changed, 0 insertions, 0 deletions
