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>
Mon, 9 Sep 2024 21:20:25 +0000 (23:20 +0200)
commit0fcc9443cd979ceebb4eba236c2e6424b5c2ceb7
tree7131cf1266ea011f1d1af063d09ac888946b69ff
parentcdd8be22961a46458c466978e7aed93c0359e1fb
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