Fix test/os to work on Solaris

Due to bad decisions made decades ago at AT&T, on SVR4 OS'es the signal()
function resets the signal handler before calling the signal handler
(equivalent to sigaction flag SA_RESETHAND).  This is why the X server
has a OsSignal() helper function in os/utils.c that uses the portable
POSIX sigaction function to provide BSD/Linux semantics in a signal()
style API, so we switch to use that in this test case, allowing it to
pass on Solaris.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Alan Coopersmith 2014-02-09 23:13:51 -08:00 committed by Keith Packard
parent 0031f6b073
commit 249565a07d

View File

@ -150,10 +150,10 @@ static void block_sigio_test_nested(void)
tail guard must be hit.
*/
void (*old_handler)(int);
old_handler = signal(SIGIO, sighandler);
old_handler = OsSignal(SIGIO, sighandler);
expect_signal = 1;
assert(raise(SIGIO) == 0);
assert(signal(SIGIO, old_handler) == sighandler);
assert(OsSignal(SIGIO, old_handler) == sighandler);
#endif
}