xserver: Branch 'master'

Daniel Drake dsd at kemper.freedesktop.org
Wed May 13 15:38:33 PDT 2015


 hw/xfree86/os-support/shared/sigio.c |    2 +-
 os/utils.c                           |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit de0e6073e3f122698c4021024bc3c09b1f408e6b
Author: Daniel Drake <drake at endlessm.com>
Date:   Mon May 11 11:35:19 2015 -0600

    Allow system call restarts upon signal interruption
    
    The X server frequently deals with SIGIO and SIGALRM interruptions.
    If process execution is inside certain blocking system calls
    when these signals arrive, e.g. with the kernel blocked on
    a contended semaphore, the system calls will be interrupted.
    
    Some system calls are automatically restartable (the kernel re-executes
    them with the same parameters once the signal handler returns) but
    only if the signal handler allows it.
    
    Set SA_RESTART on the signal handlers to enable this convenient
    behaviour.
    
    Signed-off-by: Daniel Drake <drake at endlessm.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index 45949f7..c746d02 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -178,7 +178,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
             }
             sigemptyset(&sa.sa_mask);
             sigaddset(&sa.sa_mask, SIGIO);
-            sa.sa_flags = 0;
+            sa.sa_flags = SA_RESTART;
             sa.sa_handler = xf86SIGIO;
             sigaction(SIGIO, &sa, &osa);
             xf86SigIOFuncs[i].fd = fd;
diff --git a/os/utils.c b/os/utils.c
index 7fd395b..63486b2 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1240,6 +1240,7 @@ SmartScheduleInit(void)
     memset((char *) &act, 0, sizeof(struct sigaction));
 
     /* Set up the timer signal function */
+    act.sa_flags = SA_RESTART;
     act.sa_handler = SmartScheduleTimer;
     sigemptyset(&act.sa_mask);
     sigaddset(&act.sa_mask, SIGALRM);


More information about the xorg-commit mailing list