more: make sure we have data on stderr
authorKarel Zak <kzak@redhat.com>
Thu, 22 Aug 2024 06:56:52 +0000 (08:56 +0200)
committerChris Hofstaedtler <zeha@debian.org>
Tue, 1 Oct 2024 18:13:03 +0000 (20:13 +0200)
commit11e74153bd616bacdce2d2c19758981b68e4f064
tree9d47763d0475f42fa8bf861994d6d14eaed9928b
parent1fce4ca79b9e84ad6df23c5d2fd8171712873182
more: make sure we have data on stderr

more(1) uses more_poll() to monitor data on stdin, stderr, and
signals. It is used before read_command(), but this function only
reads from stderr. Therefore, if any other non-stderr event occurs,
this function will wait on read(). In this case, more(1) will not
react to signals anymore. We need to ensure that more(1) only waits in
more_poll().

Try

 for x in {1..1000}; do echo "line $x"; done | more

to reproduce.

Reported-by: Radka Skvarilova <rskvaril@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Gbp-Pq: Topic upstream-master
Gbp-Pq: Name more-make-sure-we-have-data-on-stderr.patch
text-utils/more.c