Skip to content

Commit c0e0fc5

Browse files
cfriedtkartben
authored andcommitted
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 <[email protected]>
1 parent 3e49a19 commit c0e0fc5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/posix/fs/src/test_fs_dir.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ static int test_mkdir(void)
5454
static struct dirent *readdir_wrap(DIR *dirp, bool thread_safe)
5555
{
5656
if (thread_safe) {
57-
struct dirent entry;
57+
/* cannot declare on stack otherwise this test fails for qemu_x86/atom */
58+
static struct dirent entry;
5859
struct dirent *result = NULL;
5960

6061
zassert_ok(readdir_r(dirp, &entry, &result));

0 commit comments

Comments
 (0)