]> xenbits.xensource.com Git - qemu-xen-4.4-testing.git/commitdiff
posix_aio_init: Explicitly unblock SIGUSR1
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 11 Dec 2008 17:38:28 +0000 (17:38 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 11 Dec 2008 17:38:28 +0000 (17:38 +0000)
On Centos 4.3 as invoked by xend it seems that SIGUSR1 can be blocked.

This is almost certainly a libc bug; I checked by using sigprocmask to
obtain what was allegedly the current signal mask and printing it out
and SIGUSR1 wasn't listed, although my strace showed rt_sigprocmask
calls which clearly implied it was blocked - and indeed it wasn't
delivered.

Explicitly enabling it is an easy workaround.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
block-raw-posix.c

index 0a0a7e993e33af8c6fda309045951c1308884fc5..0e1059cfa154e78ff92070498ad8c72e26b13e69 100644 (file)
@@ -570,6 +570,7 @@ static void aio_signal_handler(int signum)
 static int posix_aio_init(void)
 {
     struct sigaction act;
+    sigset_t enable;
     PosixAioState *s;
     int fds[2];
   
@@ -580,6 +581,12 @@ static int posix_aio_init(void)
     if (s == NULL)
         return -ENOMEM;
 
+    /* under some circumstances on Centos 4.3 (at least)
+     * SIGUSR2 is mistakenly blocked, which breaks badly */
+    sigemptyset(&enable);
+    sigaddset(&enable,SIGUSR1);
+    sigprocmask(SIG_UNBLOCK,&enable,0);
+    
     sigfillset(&act.sa_mask);
     act.sa_flags = 0; /* do not restart syscalls to interrupt select() */
     act.sa_handler = aio_signal_handler;