From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Navu4-0005fh-F6 for qemu-devel@nongnu.org; Fri, 29 Jan 2010 13:49:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Navtz-0005aR-3k for qemu-devel@nongnu.org; Fri, 29 Jan 2010 13:49:11 -0500 Received: from [199.232.76.173] (port=37787 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Navty-0005Zx-Oz for qemu-devel@nongnu.org; Fri, 29 Jan 2010 13:49:06 -0500 Received: from oxygen.pond.sub.org ([213.239.205.148]:53366) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Navtx-00088y-Iv for qemu-devel@nongnu.org; Fri, 29 Jan 2010 13:49:05 -0500 From: Markus Armbruster Date: Fri, 29 Jan 2010 19:48:56 +0100 Message-Id: <1264790942-15045-2-git-send-email-armbru@redhat.com> In-Reply-To: <1264790942-15045-1-git-send-email-armbru@redhat.com> References: <1264790942-15045-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 1/7] qemu-option: Make qemu_opts_foreach() accumulate return values List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- 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