diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-04-22 14:47:11 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-03 15:46:08 +0400 |
commit | 89810e10eda30501906421a23b4f1e6c330924ac (patch) | |
tree | 3be8f2345b64988e9cb1020fa113e79d9e73776d /tests/qtest | |
parent | ed78331ddafeca55f45ce9ce8bec6c7660a6d621 (diff) | |
download | qemu-89810e10eda30501906421a23b4f1e6c330924ac.zip qemu-89810e10eda30501906421a23b4f1e6c330924ac.tar.gz qemu-89810e10eda30501906421a23b4f1e6c330924ac.tar.bz2 |
tests: replace pipe() with g_unix_open_pipe(CLOEXEC)
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'tests/qtest')
-rw-r--r-- | tests/qtest/ivshmem-test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c index bfc91d1..e23a97f 100644 --- a/tests/qtest/ivshmem-test.c +++ b/tests/qtest/ivshmem-test.c @@ -304,6 +304,7 @@ static void setup_vm_with_server(IVState *s, int nvectors) static void test_ivshmem_server(void) { + g_autoptr(GError) err = NULL; IVState state1, state2, *s1, *s2; ServerThread thread; IvshmemServer server; @@ -320,8 +321,8 @@ static void test_ivshmem_server(void) g_assert_cmpint(ret, ==, 0); thread.server = &server; - ret = pipe(thread.pipe); - g_assert_cmpint(ret, ==, 0); + g_unix_open_pipe(thread.pipe, FD_CLOEXEC, &err); + g_assert_no_error(err); thread.thread = g_thread_new("ivshmem-server", server_thread, &thread); g_assert(thread.thread != NULL); |