diff options
author | Cao jin <caoj.fnst@cn.fujitsu.com> | 2016-07-28 18:50:04 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-09-13 19:08:42 +0200 |
commit | 9cd1883c0d01813c47e0153459068f22895f4ade (patch) | |
tree | abec81d51df6afadcfd2339c66e3b7d55fa34d6d | |
parent | 3b8c1761f0e1523622e008836d01a6544b1c21ab (diff) | |
download | qemu-9cd1883c0d01813c47e0153459068f22895f4ade.zip qemu-9cd1883c0d01813c47e0153459068f22895f4ade.tar.gz qemu-9cd1883c0d01813c47e0153459068f22895f4ade.tar.bz2 |
util/qemu-sockets: revert Yoda Conditions to normal
Follow CODING_STYLE
Cc: Daniel P. Berrange <berrange@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Message-Id: <1469703004-14800-1-git-send-email-caoj.fnst@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | util/qemu-sockets.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 2aed799..9fa0156 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -491,7 +491,7 @@ static int inet_dgram_saddr(InetSocketAddress *sraddr, goto err; } - if (0 != (rc = getaddrinfo(addr, port, &ai, &peer))) { + if ((rc = getaddrinfo(addr, port, &ai, &peer)) != 0) { error_setg(errp, "address resolution failed for %s:%s: %s", addr, port, gai_strerror(rc)); goto err; @@ -517,7 +517,7 @@ static int inet_dgram_saddr(InetSocketAddress *sraddr, port = "0"; } - if (0 != (rc = getaddrinfo(addr, port, &ai, &local))) { + if ((rc = getaddrinfo(addr, port, &ai, &local)) != 0) { error_setg(errp, "address resolution failed for %s:%s: %s", addr, port, gai_strerror(rc)); goto err; @@ -573,20 +573,20 @@ InetSocketAddress *inet_parse(const char *str, Error **errp) if (str[0] == ':') { /* no host given */ host[0] = '\0'; - if (1 != sscanf(str, ":%32[^,]%n", port, &pos)) { + if (sscanf(str, ":%32[^,]%n", port, &pos) != 1) { error_setg(errp, "error parsing port in address '%s'", str); goto fail; } } else if (str[0] == '[') { /* IPv6 addr */ - if (2 != sscanf(str, "[%64[^]]]:%32[^,]%n", host, port, &pos)) { + if (sscanf(str, "[%64[^]]]:%32[^,]%n", host, port, &pos) != 2) { error_setg(errp, "error parsing IPv6 address '%s'", str); goto fail; } addr->ipv6 = addr->has_ipv6 = true; } else { /* hostname or IPv4 addr */ - if (2 != sscanf(str, "%64[^:]:%32[^,]%n", host, port, &pos)) { + if (sscanf(str, "%64[^:]:%32[^,]%n", host, port, &pos) != 2) { error_setg(errp, "error parsing address '%s'", str); goto fail; } |