path: root/slirp/misc.c
diff options
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-02-12 17:09:52 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-02-12 20:47:42 +0100
commitfdbfba8cbf04b587f9bab11b8e6a87afc38556e5 (patch)
tree37a867a670f31469c4fd0388601202aabca3f763 /slirp/misc.c
parent0b5e750bea635b167eb03d86c3d9a09bbd43bc06 (diff)
slirp: remove slirp_ prefix for socket wrappers
QEMU wraps the socket functions in os-win32.h, but in commit a9d8b3ec4385793815d71217857304, the header inclusion was dropped, breaking libslirp on Windows. There are already a few socket functions that are wrapped in libslirp, with "slirp_" prefix, but many of them are missing, and we are going to wrap the missing functions in a second patch. Using "slirp_" prefix avoids the conflict with socket function #define wrappers in QEMU os-win32.h, but they are quite intrusive. In the end, the functions should behave the same as original one, but with errno being set. To avoid the churn, and potential confusion, remove the "slirp_" prefix. A series of #undef is necessary until libslirp is made standalone to prevent the #define conflict with QEMU. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190212160953.29051-2-marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/misc.c')
1 files changed, 7 insertions, 7 deletions
diff --git a/slirp/misc.c b/slirp/misc.c
index 3f4cd852f8..d9fc586a24 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -98,16 +98,16 @@ slirp_socketpair_with_oob(int sv[2])
goto err;
- slirp_closesocket(s);
+ closesocket(s);
return 0;
g_critical("slirp_socketpair(): %s", strerror(errno));
if (s >= 0) {
- slirp_closesocket(s);
+ closesocket(s);
if (sv[1] >= 0) {
- slirp_closesocket(sv[1]);
+ closesocket(sv[1]);
return -1;
@@ -211,16 +211,16 @@ fork_exec(struct socket *so, const char *ex)
if (err) {
g_critical("fork_exec: %s", err->message);
- slirp_closesocket(sp[0]);
- slirp_closesocket(sp[1]);
+ closesocket(sp[0]);
+ closesocket(sp[1]);
return 0;
so->s = sp[0];
- slirp_closesocket(sp[1]);
+ closesocket(sp[1]);
opt = 1;
- slirp_setsockopt(so->s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int));
+ setsockopt(so->s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(int));
so->slirp->cb->register_poll_fd(so->s, so->slirp->opaque);
return 1;