qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/7] qemu-option: Make qemu_opts_foreach() accumulat


From: Markus Armbruster
Subject: [Qemu-devel] [PATCH 1/7] qemu-option: Make qemu_opts_foreach() accumulate return values
Date: Fri, 29 Jan 2010 19:48:56 +0100

Return the bitwise inclusive or of all return values instead of the
last call's value.  This lets you find out whether any of the calls
returned a non-zero value.

No functional change, as existing users either don't care for the
value, or pass non-zero abort_on_failure, which breaks the loop on the
first non-zero return value.

Signed-off-by: Markus Armbruster <address@hidden>
---
 qemu-option.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qemu-option.c b/qemu-option.c
index 24392fc..a52a4c4 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -814,7 +814,7 @@ int qemu_opts_foreach(QemuOptsList *list, 
qemu_opts_loopfunc func, void *opaque,
     int rc = 0;
 
     QTAILQ_FOREACH(opts, &list->head, next) {
-        rc = func(opts, opaque);
+        rc |= func(opts, opaque);
         if (abort_on_failure  &&  rc != 0)
             break;
     }
-- 
1.6.6





reply via email to

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