Skip to content

Commit

Permalink
fix readdir for localfs
Browse files Browse the repository at this point in the history
Signed-off-by: Lanzheng Liu <[email protected]>
  • Loading branch information
liulanzheng committed Feb 21, 2024
1 parent c70d698 commit fb6eb1f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/localfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ namespace fs
::DIR* dirp;
::dirent* direntp;
long loc;
::dirent m_dirent;

LocalDIR(::DIR* dirp) : dirp(dirp)
{
next();
Expand All @@ -313,6 +315,10 @@ namespace fs
}
virtual dirent* get() override
{
if (direntp) {
memcpy(&m_dirent, direntp, sizeof(m_dirent));
return &m_dirent;
}
return direntp;
}
virtual int next() override
Expand Down

0 comments on commit fb6eb1f

Please sign in to comment.