[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/12] qga: fix false negative argument passing
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 05/12] qga: fix false negative argument passing |
Date: |
Mon, 17 Nov 2014 18:08:12 +0100 |
From: Gonglei <address@hidden>
Function send_response(s, &qdict->base) returns a negative number
when any failures occured. But strerror()'s parameter cannot be
negative. Let's change the testing condition and pass '-ret' to
strerr().
Signed-off-by: Gonglei <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
qga/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qga/main.c b/qga/main.c
index 227f2bd..9939a2b 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -603,8 +603,8 @@ static void process_event(JSONMessageParser *parser, QList
*tokens)
error_free(err);
}
ret = send_response(s, QOBJECT(qdict));
- if (ret) {
- g_warning("error sending error response: %s", strerror(ret));
+ if (ret < 0) {
+ g_warning("error sending error response: %s", strerror(-ret));
}
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/12] Coverity fixes for 2.2.0-rc2, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 01/12] libcacard: fix resource leak, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 02/12] l2tpv3: fix possible double free, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 03/12] l2tpv3: fix fd leak, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 04/12] mips_mipssim: fix use-after-free for filename, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 06/12] loader: fix NEGATIVE_RETURNS, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 05/12] qga: fix false negative argument passing,
Paolo Bonzini <=
- [Qemu-devel] [PULL 07/12] nvme: remove superfluous check, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 08/12] acl: fix memory leak, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 09/12] qemu-char: fix MISSING_COMMA, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 10/12] shpc: fix error propaagation, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 11/12] target-cris/translate.c: fix out of bounds read, Paolo Bonzini, 2014/11/17
- [Qemu-devel] [PULL 12/12] hcd-musb: fix dereference null return value, Paolo Bonzini, 2014/11/17
- Re: [Qemu-devel] [PULL 00/12] Coverity fixes for 2.2.0-rc2, Peter Maydell, 2014/11/17