diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-01-04 15:52:10 +0100 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2017-01-24 23:26:53 +0300 |
commit | 47b0c3f2f5dd7dea486aa023a007cb2442da0676 (patch) | |
tree | f3fdb1becb7b6d93c46113809ec543192cd90586 /qga/main.c | |
parent | 7ad2757feffd13b8000826ae3df2a3bc929d688d (diff) |
qga: fix erroneous argument to strerror
process_command returns a negative value in case of error. Make this
clear in the "if" statement and fix the strerror argument to flip it
to positive.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'qga/main.c')
-rw-r--r-- | qga/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qga/main.c b/qga/main.c index 6caf215575..538e4ee299 100644 --- a/qga/main.c +++ b/qga/main.c @@ -558,8 +558,8 @@ static void process_command(GAState *s, QDict *req) rsp = qmp_dispatch(QOBJECT(req)); if (rsp) { ret = send_response(s, rsp); - if (ret) { - g_warning("error sending response: %s", strerror(ret)); + if (ret < 0) { + g_warning("error sending response: %s", strerror(-ret)); } qobject_decref(rsp); } |