tests: posix: fs: declare entry statically

qemu_x86/atom was failing tests/posix/fs in
test_fs_readdir_threadsafe for some reason and only for that
platform.

All other platforms pass the testsuite properly with the dirent
declared on the stack.

Declare the dirent object statically so that qemu_x86/atom will
pass test cases.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
Chris Friedt 2025-01-03 13:23:34 -05:00 committed by Benjamin Cabé
commit c0e0fc5d7f

View file

@ -54,7 +54,8 @@ static int test_mkdir(void)
static struct dirent *readdir_wrap(DIR *dirp, bool thread_safe)
{
if (thread_safe) {
struct dirent entry;
/* cannot declare on stack otherwise this test fails for qemu_x86/atom */
static struct dirent entry;
struct dirent *result = NULL;
zassert_ok(readdir_r(dirp, &entry, &result));