]> granicus.if.org Git - file/commit
From: Denys Vlasenko
authorChristos Zoulas <christos@zoulas.com>
Tue, 7 May 2019 02:20:27 +0000 (02:20 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 7 May 2019 02:20:27 +0000 (02:20 +0000)
commit0c7282b171f1f14aaa6ad126d947dc09c7a1404e
tree4fb5d22ba30d8b0c9cda4cf2da3cb4cb896385b4
parent2ab9e453ce24bebefd1776c46224e5f77faa86ae
From: Denys Vlasenko

Use sigaction(2) to save and restore SIGPIPE instead of signal(3)
because signal(3) does not have reliable semantics with respect to
SA_RESTART across all platforms: The original BSD semantics are to
always set SA_RESTART whereas the "new" BSD semantics were to keep
what siginterrupt(2) did.

And two missed optimizations:
= The saving/restoring of SIGPIPE is done even if file turns out
  to be *not* compressed, and no decompressor is called.
= If old signal was already SIG_IGN, no need to restore it.

This causes, for example, ~160000 unnecessary calls
to rt_sigaction() when rpmbuild generates kernel rpms.

Finally we can't share the old and new sigaction pointer because
of the "restrict" semantics.
src/compress.c