mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-05 11:39:54 +00:00
util: fix some coding style issue
Fix some coding style issues found in removing NonBlockingConnectHandler. Cc: Daniel P. Berrange <berrange@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Reviwed-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Message-Id: <1469696074-12744-3-git-send-email-caoj.fnst@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9cd1883c0d
commit
2601505121
@ -494,7 +494,7 @@ static int inet_dgram_saddr(InetSocketAddress *sraddr,
|
||||
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;
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* lookup local addr */
|
||||
@ -548,12 +548,16 @@ static int inet_dgram_saddr(InetSocketAddress *sraddr,
|
||||
return sock;
|
||||
|
||||
err:
|
||||
if (-1 != sock)
|
||||
if (sock != -1) {
|
||||
closesocket(sock);
|
||||
if (local)
|
||||
}
|
||||
if (local) {
|
||||
freeaddrinfo(local);
|
||||
if (peer)
|
||||
}
|
||||
if (peer) {
|
||||
freeaddrinfo(peer);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -816,8 +820,10 @@ int unix_listen(const char *str, char *ostr, int olen, Error **errp)
|
||||
|
||||
sock = unix_listen_saddr(saddr, true, errp);
|
||||
|
||||
if (sock != -1 && ostr)
|
||||
if (sock != -1 && ostr) {
|
||||
snprintf(ostr, olen, "%s%s", saddr->path, optstr ? optstr : "");
|
||||
}
|
||||
|
||||
qapi_free_UnixSocketAddress(saddr);
|
||||
return sock;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user