[PATCH 2/2] Fix test/os to work on Solaris
Alan Coopersmith
alan.coopersmith at oracle.com
Sun Feb 9 23:13:51 PST 2014
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 at oracle.com>
---
test/os.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/os.c b/test/os.c
index 2d005a0..d85dcff 100644
--- a/test/os.c
+++ b/test/os.c
@@ -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
}
--
1.7.9.2
More information about the xorg-devel
mailing list