qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/18] posix-aio-compat.c: fix warning with _FOR


From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH 03/18] posix-aio-compat.c: fix warning with _FORTIFY_SOURCE
Date: Sun, 20 Dec 2009 23:02:56 +0000
User-agent: KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; )

> --- a/posix-aio-compat.c
> +++ b/posix-aio-compat.c
> @@ -502,7 +502,8 @@ static void aio_signal_handler(int signum)
>      if (posix_aio_state) {
>          char byte = 0;
> 
> -  write(posix_aio_state->wfd, &byte, sizeof(byte));
> +  if (write(posix_aio_state->wfd, &byte, sizeof(byte)) != sizeof(byte))
> +    die("write()");

I'm pretty sure this change is wrong, and shows why you should never blindly 
believe dumb analysis tools.

The write may fail harmlessly if the pipe is already full.

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]