Skip to content

Commit

Permalink
Merge pull request alibaba#370 from liulanzheng/release/0.6
Browse files Browse the repository at this point in the history
fix readdir for localfs
  • Loading branch information
liulanzheng authored Feb 21, 2024
2 parents d2e6eb5 + fb6eb1f commit 13a4ffd
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 13a4ffd

Please sign in to comment.