From 27463101f15bee17d2f46642c48a7373bc6c595e Mon Sep 17 00:00:00 2001 From: aliguori Date: Sat, 27 Sep 2008 20:58:43 +0000 Subject: Make compatfd fallback more robust Be more friendly when signalfd() fails, and also add configure checks to detect that syscall(SYS_signalfd) actually works. malc pointed out that some installs do not have /usr/include/linux headers that are in sync with the glibc headers so why SYS_signalfd is defined, it's #defined to _NR_signalfd which is not defined in the /usr/include/linux header. While this is a distro bug, it doesn't hurt to do a more thorough job in detection. Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5334 c046a42c-6fe2-441c-8c8c-71466251a162 --- block-raw-posix.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'block-raw-posix.c') diff --git a/block-raw-posix.c b/block-raw-posix.c index 2875fa1bfc..267d6c07bd 100644 --- a/block-raw-posix.c +++ b/block-raw-posix.c @@ -584,6 +584,10 @@ static int posix_aio_init(void) s->first_aio = NULL; s->fd = qemu_signalfd(&mask); + if (s->fd == -1) { + fprintf(stderr, "failed to create signalfd\n"); + return -errno; + } fcntl(s->fd, F_SETFL, O_NONBLOCK); -- cgit v1.2.3