tests: posix: fs: correct arguments to readdir_r()
Previously, a NULL pointer was passed as the second argument to readdir_r(). This is incorrect. The passed pointer should be to a valid, externally-allocated struct direct. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
parent
4e503748a5
commit
e967120b9a
1 changed files with 2 additions and 2 deletions
|
@ -57,10 +57,10 @@ static int test_mkdir(void)
|
||||||
static struct dirent *readdir_wrap(DIR *dirp, bool thread_safe)
|
static struct dirent *readdir_wrap(DIR *dirp, bool thread_safe)
|
||||||
{
|
{
|
||||||
if (thread_safe) {
|
if (thread_safe) {
|
||||||
struct dirent *entry = NULL;
|
struct dirent entry;
|
||||||
struct dirent *result = NULL;
|
struct dirent *result = NULL;
|
||||||
|
|
||||||
zassert_ok(readdir_r(dirp, entry, &result));
|
zassert_ok(readdir_r(dirp, &entry, &result));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue