Use sigsetjmp()/siglongjmp() when available

Without using siglongjmp, the signal mask is not restored when
longjmp-ing from the signal handler, and whichever signal was
being handled remains blocked for the remainder of the tests. As a
result, the same signal cannot be caught twice, and will cause process
termination when being raised the second time.

This does not change 'jmp_buf global_expect_assert_env', because it is
part of the public API, and isn't used from a signal handler.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
3 files changed