summaryrefslogtreecommitdiff
path: root/block-raw-posix.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-27 20:58:43 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-27 20:58:43 +0000
commit27463101f15bee17d2f46642c48a7373bc6c595e (patch)
treed542c7676a0da3b27271b60df27eab23e879368a /block-raw-posix.c
parentb8ae75538e8a9db54207e6bf3da484939bb5df7e (diff)
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 <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5334 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-raw-posix.c')
-rw-r--r--block-raw-posix.c4
1 files changed, 4 insertions, 0 deletions
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);