aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/libqtest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 825b13a44c..73f6b977a6 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -301,7 +301,9 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args)
s->expected_status = 0;
s->qemu_pid = fork();
if (s->qemu_pid == 0) {
- g_setenv("QEMU_AUDIO_DRV", "none", true);
+ if (!g_setenv("QEMU_AUDIO_DRV", "none", true)) {
+ exit(1);
+ }
execlp("/bin/sh", "sh", "-c", command, NULL);
exit(1);
}