[File-cvs] CVS commit: file/src

Christos Zoulas christos at zoulas.com
Tue May 7 02:20:27 UTC 2019

Module Name:	file
Committed By:	christos
Date:		Tue May  7 02:20:27 UTC 2019

Modified Files:
	file/src: compress.c

Log Message:
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.

To generate a diff of this commit:
cvs rdiff -r1.119 -r1.120 file/src/compress.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

More information about the File-cvs mailing list