From c0e0fc5d7f7f6febb5d5155ff414b2ab686a4547 Mon Sep 17 00:00:00 2001 From: Chris Friedt Date: Fri, 3 Jan 2025 13:23:34 -0500 Subject: [PATCH] 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 --- tests/posix/fs/src/test_fs_dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/posix/fs/src/test_fs_dir.c b/tests/posix/fs/src/test_fs_dir.c index ccd760fa21f..9b97413a4bc 100644 --- a/tests/posix/fs/src/test_fs_dir.c +++ b/tests/posix/fs/src/test_fs_dir.c @@ -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));