]> git.ipfire.org Git - thirdparty/coreutils.git/commit
ls: allow interruption when reading slow directories
authorKamil Dudka <kdudka@redhat.com>
Tue, 6 Sep 2016 15:38:26 +0000 (17:38 +0200)
committerPádraig Brady <P@draigBrady.com>
Wed, 7 Sep 2016 09:16:59 +0000 (10:16 +0100)
commit5445f7811ff945ea13aa2a0fd797eb4c0a0e4db0
tree4be1468294a8ede68d9602609618b56b0f0fc9af
parent22d188e2991ce64445ba89dbb32e3c6bec42e235
ls: allow interruption when reading slow directories

Postpone installation of signal handlers until they're needed.
That is right before the first escape sequence is printed.

* src/ls.c (signal_setup): A new function refactored from main()
to set and restore signal handlers.
(main): Move signal handler setup to put_indicator()
so that the default signal handling is untouched as long as possible.
Adjusted condition for restoring signal handlers to reflect the change.
(put_indicator): Install signal handlers if called for the very first
time.  It uses the same code that was in main() prior to this commit.
* NEWS: Mention the improvement.

See https://bugzilla.redhat.com/1365933
Fixes http://bugs.gnu.org/24232
NEWS
src/ls.c