From 1cf016414a13a922b0643738adb34270f719449f Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Wed, 20 Jan 2010 00:56:10 +0100 Subject: [PATCH] posix-aio-compat.c: fix warning with _FORTIFY_SOURCE CC posix-aio-compat.o cc1: warnings being treated as errors posix-aio-compat.c: In function 'aio_signal_handler': posix-aio-compat.c:505: error: ignoring return value of 'write', declared with attribute warn_unused_result make: *** [posix-aio-compat.o] Error 1 Signed-off-by: Kirill A. Shutemov Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori --- posix-aio-compat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posix-aio-compat.c b/posix-aio-compat.c index dc14f53..b43c531 100644 --- a/posix-aio-compat.c +++ b/posix-aio-compat.c @@ -501,8 +501,11 @@ static void aio_signal_handler(int signum) { if (posix_aio_state) { char byte = 0; + ssize_t ret; - write(posix_aio_state->wfd, &byte, sizeof(byte)); + ret = write(posix_aio_state->wfd, &byte, sizeof(byte)); + if (ret < 0 && errno != EAGAIN) + die("write()"); } qemu_service_io(); -- 2.7.4