From 1f4f23ae9fc220eec55aa742f67f5bb47716bcc6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 11 Dec 2008 17:38:28 +0000 Subject: [PATCH] posix_aio_init: Explicitly unblock SIGUSR1 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 --- block-raw-posix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block-raw-posix.c b/block-raw-posix.c index 0a0a7e993..0e1059cfa 100644 --- a/block-raw-posix.c +++ b/block-raw-posix.c @@ -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; -- 2.39.5