qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v1 2/4] util/oslib-win32: Remove invalid check


From: Alistair Francis
Subject: Re: [Qemu-devel] [RFC v1 2/4] util/oslib-win32: Remove invalid check
Date: Thu, 29 Jun 2017 09:37:48 -0700

On Thu, Jun 29, 2017 at 6:32 AM, Paolo Bonzini <address@hidden> wrote:
> On 28/06/2017 01:57, Alistair Francis wrote:
>> There is no way nhandles can be zero in this section so that part of the
>> if statement will always be false. Let's just remove it to make the code
>> easier to read.
>>
>> Signed-off-by: Alistair Francis <address@hidden>
>> Acked-by: Edgar E. Iglesias <address@hidden>
>> ---
>>
>>  util/oslib-win32.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/util/oslib-win32.c b/util/oslib-win32.c
>> index 80e4668935..7ec0f8e083 100644
>> --- a/util/oslib-win32.c
>> +++ b/util/oslib-win32.c
>> @@ -414,7 +414,7 @@ static int poll_rest(gboolean poll_msgs, HANDLE 
>> *handles, gint nhandles,
>>          /* If we have a timeout, or no handles to poll, be satisfied
>>           * with just noticing we have messages waiting.
>>           */
>> -        if (timeout != 0 || nhandles == 0) {
>> +        if (timeout != 0) {
>>              return 1;
>>          }
>>
>>
>
> Hmm, I think it's possible, poll_msgs is true here.

poll_msgs?

If nhandles is 0 then we have already entered an earlier if statement
and set ready to either WAIT_FAILED or WAIT_TIMEOUT in which case we
can't enter this part of the if statement.

Thanks,
Alistair

>
> Paolo



reply via email to

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