qemu-sockets: unix_listen and unix_connect are portable

They are just wrappers and do not need a Win32-specific version.

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2012-10-18 08:44:00 +02:00
parent 7fc4e63ec0
commit 0c81470947
1 changed files with 17 additions and 32 deletions

View File

@ -730,6 +730,23 @@ int unix_connect_opts(QemuOpts *opts, Error **errp)
return sock;
}
#else
int unix_listen_opts(QemuOpts *opts, Error **errp)
{
fprintf(stderr, "unix sockets are not available on windows\n");
errno = ENOTSUP;
return -1;
}
int unix_connect_opts(QemuOpts *opts, Error **errp)
{
fprintf(stderr, "unix sockets are not available on windows\n");
errno = ENOTSUP;
return -1;
}
#endif
/* compatibility wrapper */
int unix_listen(const char *str, char *ostr, int olen, Error **errp)
{
@ -772,38 +789,6 @@ int unix_connect(const char *path, Error **errp)
return sock;
}
#else
int unix_listen_opts(QemuOpts *opts, Error **errp)
{
fprintf(stderr, "unix sockets are not available on windows\n");
errno = ENOTSUP;
return -1;
}
int unix_connect_opts(QemuOpts *opts, Error **errp)
{
fprintf(stderr, "unix sockets are not available on windows\n");
errno = ENOTSUP;
return -1;
}
int unix_listen(const char *path, char *ostr, int olen, Error **errp)
{
fprintf(stderr, "unix sockets are not available on windows\n");
errno = ENOTSUP;
return -1;
}
int unix_connect(const char *path, Error **errp)
{
fprintf(stderr, "unix sockets are not available on windows\n");
errno = ENOTSUP;
return -1;
}
#endif
#ifdef _WIN32
static void socket_cleanup(void)
{