sockets: use error class to pass listen error

Add a new argument in inet_listen()/inet_listen_opts()
to pass back listen error.

Change nbd, qemu-char, vnc to use new interface.

Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Amos Kong 2012-05-11 00:28:26 +08:00 committed by Anthony Liguori
parent a6ba35b3be
commit 029409e5a9
5 changed files with 20 additions and 8 deletions

2
nbd.c
View file

@ -176,7 +176,7 @@ int tcp_socket_incoming_spec(const char *address_and_port)
{
char *ostr = NULL;
int olen = 0;
return inet_listen(address_and_port, ostr, olen, SOCK_STREAM, 0);
return inet_listen(address_and_port, ostr, olen, SOCK_STREAM, 0, NULL);
}
int unix_socket_incoming(const char *path)