Skip to contentSkip to conversation

aio-win32: fix uninitialized use of have_select_revents

PATCH Applied Paolo Bonzini 4 participants 4 messages Sep 12, 2014 – Sep 15, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aio-win32: fix uninitialized use of have_select_revents

Always initialize it with the return value of aio_prepare.

---
 aio-win32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
aio-win32.c +2 -2
index 61e3d2d..7daeae1 100644
@@ -283,9 +283,9 @@ bool aio_poll(AioContext *ctx, bool blocking)
     int count;
     int timeout;
 
-    if (aio_prepare(ctx)) {
+    have_select_revents = aio_prepare(ctx);
+    if (have_select_revents) {
         blocking = false;
-        have_select_revents = true;
     }
 
     was_dispatching = ctx->dispatching;
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini
Quoted 27 lines · Paolo Bonzini

Always initialize it with the return value of aio_prepare.

---
 aio-win32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
aio-win32.c +2 -2
index 61e3d2d..7daeae1 100644
@@ -283,9 +283,9 @@ bool aio_poll(AioContext *ctx, bool blocking)
     int count;
     int timeout;
 
-    if (aio_prepare(ctx)) {
+    have_select_revents = aio_prepare(ctx);
+    if (have_select_revents) {
         blocking = false;
-        have_select_revents = true;
     }
 
     was_dispatching = ctx->dispatching;
Signature · 1 line
2.1.0