Skip to content

Commit

Permalink
test: Use g_get_tmp_dir()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
martinpitt committed Nov 21, 2023
1 parent a1f42d2 commit a01855f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test-umockdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a01855f

Please sign in to comment.