xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Feb 24 16:32:54 PST 2014


 test/os.c             |    4 ++--
 test/signal-logging.c |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 249565a07d1d243e27440e2a5ecf4c95490903c6
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Feb 9 23:13:51 2014 -0800

    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 at oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

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
 }
 
commit 0031f6b073c7a4cca553c1d3e185a63436a75cbe
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Feb 9 23:13:50 2014 -0800

    Fix test/signal-logging to work on Solaris
    
    For some reason, Solaris libc sprintf() doesn't add "0x" to the %p output
    as glibc does, causing the test to fail for not matching the exact output.
    Since the 0x is desirable, we add it ourselves to the test string.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/test/signal-logging.c b/test/signal-logging.c
index d894373..88b37c1 100644
--- a/test/signal-logging.c
+++ b/test/signal-logging.c
@@ -346,7 +346,11 @@ static void logging_format(void)
     ptr = 1;
     do {
         char expected[30];
+#ifdef __sun /* Solaris doesn't autoadd "0x" to %p format */
+        sprintf(expected, "(EE) 0x%p\n", (void*)ptr);
+#else
         sprintf(expected, "(EE) %p\n", (void*)ptr);
+#endif
         LogMessageVerbSigSafe(X_ERROR, -1, "%p\n", (void*)ptr);
         read_log_msg(logmsg);
         assert(strcmp(logmsg, expected) == 0);


More information about the xorg-commit mailing list