• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision4113 (tree)
Time2020-10-11 23:01:12
Authormagicant

Log Message

Refactor reset_special_handler

Change Summary

Incremental Difference

--- yash/trunk/sig.c (revision 4112)
+++ yash/trunk/sig.c (revision 4113)
@@ -457,15 +457,20 @@
457457 * unchanged if the handler is supposed to be reset during exec. */
458458 void reset_special_handler(int signum, void (*handler)(int signum), bool leave)
459459 {
460+ if (sigismember(&trapped_signals, signum)) {
461+ assert(!sigismember(&officially_ignored_signals, signum));
462+ return;
463+ }
464+
460465 struct sigaction action;
461466 if (sigismember(&officially_ignored_signals, signum))
462467 action.sa_handler = SIG_IGN;
463- else if (sigismember(&trapped_signals, signum))
464- return;
465468 else
466469 action.sa_handler = SIG_DFL;
470+
467471 if (leave && handler != SIG_IGN)
468472 handler = SIG_DFL;
473+
469474 if (handler != action.sa_handler) {
470475 action.sa_flags = 0;
471476 sigemptyset(&action.sa_mask);
Show on old repository browser