@@ -224,14 +224,14 @@ static bool check_guest_output(QTestState *qts, const testdef_t *test, int fd)
static void test_machine(const void *data)
{
const testdef_t *test = data;
- char serialtmp[] = "/tmp/qtest-boot-serial-sXXXXXX";
- char codetmp[] = "/tmp/qtest-boot-serial-cXXXXXX";
+ g_autofree char *serialtmp = NULL;
+ g_autofree char *codetmp = NULL;
const char *codeparam = "";
const uint8_t *code = NULL;
QTestState *qts;
int ser_fd;
- ser_fd = mkstemp(serialtmp);
+ ser_fd = g_file_open_tmp("qtest-boot-serial-sXXXXXX", &serialtmp, NULL);
g_assert(ser_fd != -1);
if (test->kernel) {
@@ -246,7 +246,7 @@ static void test_machine(const void *data)
ssize_t wlen;
int code_fd;
- code_fd = mkstemp(codetmp);
+ code_fd = g_file_open_tmp("qtest-boot-serial-cXXXXXX", &codetmp, NULL);
g_assert(code_fd != -1);
wlen = write(code_fd, code, test->codesize);
g_assert(wlen == test->codesize);