]> git.ipfire.org Git - thirdparty/util-linux.git/commit
more: make sure we have data on stderr
authorKarel Zak <kzak@redhat.com>
Thu, 22 Aug 2024 06:56:52 +0000 (08:56 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 3 Jan 2025 11:21:42 +0000 (12:21 +0100)
commit209e17be97ff5d955728515ea0c66628ed30e07d
tree8141996d4f83f0095ab246949f1a0a53ca0f63e7
parent3de9ae363cd2881575825fdc2e01cf0886e50feb
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>
(cherry picked from commit 640b9480bd3efc0f4bc7f38a785d02cda70ec5c3)
text-utils/more.c