From a01855f5941eda0abff4cf563fc132caf4c96984 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 21 Nov 2023 17:33:59 +0100 Subject: [PATCH] test: Use g_get_tmp_dir() This ensures that the emulated /dev (which is created in `g_get_tmp_dir()` via `DirUtils.make_tmp()` and the feature check are done in the same directory. If `$TMPDIR` is set, that may not be the case. Fixes #217 --- tests/test-umockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-umockdev.c b/tests/test-umockdev.c index af40668..01ed911 100644 --- a/tests/test-umockdev.c +++ b/tests/test-umockdev.c @@ -1394,7 +1394,7 @@ t_testbed_dev_access(UMockdevTestbedFixture * fixture, UNUSED_DATA) /* open() with O_TMPFILE; this hasn't been supported in Linux for very long * (>= 3.11), so check that it works in the testbed only if it also works * in the "normal" file system. */ - fd = g_open("/tmp", O_TMPFILE|O_RDWR, 0644); + fd = g_open(g_get_tmp_dir(), O_TMPFILE|O_RDWR, 0644); if (fd >= 0) { close(fd); errno = 0;