Skip to content

Commit

Permalink
lx_fs: fix build errors with GCC 12
Browse files Browse the repository at this point in the history
/data/genode/repos/os/src/server/lx_fs/directory.h: In member function ‘virtual Genode::size_t Lx_fs::Directory::read(char*, Genode::size_t, File_system::seek_off_t)’:
/data/genode/repos/os/src/server/lx_fs/directory.h:224:53: error: ‘dent’ may be used uninitialized [-Werror=maybe-uninitialized]
  224 |                                 .type  = type(dent->d_type),
      |                                               ~~~~~~^~~~~~
/data/genode/repos/os/src/server/lx_fs/directory.h:197:40: note: ‘dent’ was declared here
  197 |                         struct dirent *dent;
      |                                        ^~~~

Issue #4827
  • Loading branch information
chelmuth committed May 30, 2023
1 parent d59a2b4 commit 37d1855
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions repos/os/src/server/lx_fs/directory.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ class Lx_fs::Directory : public Node

seek_off_t index = seek_offset / sizeof(Directory_entry);

/* seek to index and read entry */
struct dirent *dent;
/* seek to index */
rewinddir(_fd);
for (unsigned i = 0; i <= index; ++i) {
dent = readdir(_fd);
}
for (unsigned i = 0; i < index; ++i)
readdir(_fd);

struct dirent *dent = readdir(_fd);

if (!dent)
return 0;
Expand Down

0 comments on commit 37d1855

Please sign in to comment.