aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorGuoyi Tu <tugy@chinatelecom.cn>2023-01-16 12:56:00 +0800
committerLaurent Vivier <laurent@vivier.eu>2023-01-16 17:42:17 +0100
commit0038e9a22619387a905b57888fb34c5d8ece720e (patch)
tree913a823fd6275c938b3e46489928888a2972ec63 /tests/unit
parenta8d6abe1292e1db1ad9be5b2b124b9c01bcda094 (diff)
downloadqemu-0038e9a22619387a905b57888fb34c5d8ece720e.zip
qemu-0038e9a22619387a905b57888fb34c5d8ece720e.tar.gz
qemu-0038e9a22619387a905b57888fb34c5d8ece720e.tar.bz2
Call qemu_socketpair() instead of socketpair() when possible
As qemu_socketpair() was introduced in commit 3c63b4e9 ("oslib-posix: Introduce qemu_socketpair()"), it's time to replace the other existing socketpair() calls with qemu_socketpair() if possible Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn> Acked-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <cd28916a-f1f3-b54e-6ade-8a3647c3a9a5@chinatelecom.cn> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test-crypto-tlssession.c4
-rw-r--r--tests/unit/test-io-channel-tls.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/test-crypto-tlssession.c b/tests/unit/test-crypto-tlssession.c
index 615a134..b12e7b6 100644
--- a/tests/unit/test-crypto-tlssession.c
+++ b/tests/unit/test-crypto-tlssession.c
@@ -82,7 +82,7 @@ static void test_crypto_tls_session_psk(void)
int ret;
/* We'll use this for our fake client-server connection */
- ret = socketpair(AF_UNIX, SOCK_STREAM, 0, channel);
+ ret = qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, channel);
g_assert(ret == 0);
/*
@@ -236,7 +236,7 @@ static void test_crypto_tls_session_x509(const void *opaque)
int ret;
/* We'll use this for our fake client-server connection */
- ret = socketpair(AF_UNIX, SOCK_STREAM, 0, channel);
+ ret = qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, channel);
g_assert(ret == 0);
/*
diff --git a/tests/unit/test-io-channel-tls.c b/tests/unit/test-io-channel-tls.c
index cc39247..e036ac5 100644
--- a/tests/unit/test-io-channel-tls.c
+++ b/tests/unit/test-io-channel-tls.c
@@ -121,7 +121,7 @@ static void test_io_channel_tls(const void *opaque)
GMainContext *mainloop;
/* We'll use this for our fake client-server connection */
- g_assert(socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == 0);
+ g_assert(qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == 0);
#define CLIENT_CERT_DIR "tests/test-io-channel-tls-client/"
#define SERVER_CERT_DIR "tests/test-io-channel-tls-server/"