sanitizer_common: fix SIG_DFL warning
authorDmitry Vyukov <dvyukov@google.com>
Mon, 10 May 2021 11:43:20 +0000 (13:43 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Wed, 12 May 2021 05:23:20 +0000 (07:23 +0200)
commit53558ed8a0abaf2f457cfa3d98c85d0fa1e84b22
tree88f99b13208d1b14cc3adc98666eb9021b3769bd
parent8214764f35e1b764fb939e18f16e11aa43073469
sanitizer_common: fix SIG_DFL warning

Currently we have:

sanitizer_posix_libcdep.cpp:146:27: warning: cast between incompatible
  function types from ‘__sighandler_t’ {aka ‘void (*)(int)’} to ‘sa_sigaction_t’
  146 |     sigact.sa_sigaction = (sa_sigaction_t)SIG_DFL;

We don't set SA_SIGINFO, so we need to assign to sa_handler.
And SIG_DFL is meant for sa_handler, so this gets rid of both
compiler warning, type cast and potential runtime misbehavior.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D102162
compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp