mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-31 14:40:54 +00:00
parent
ca0c86e7af
commit
c9f4b455c5
@ -160,6 +160,8 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
struct stat s;
|
struct stat s;
|
||||||
rump_sys_lstat(path, &s);
|
rump_sys_lstat(path, &s);
|
||||||
|
|
||||||
|
vfs_dir.fileno = s.st_ino;
|
||||||
|
|
||||||
if (S_ISREG(s.st_mode))
|
if (S_ISREG(s.st_mode))
|
||||||
vfs_dir.type = Dirent_type::DIRENT_TYPE_FILE;
|
vfs_dir.type = Dirent_type::DIRENT_TYPE_FILE;
|
||||||
else if (S_ISDIR(s.st_mode))
|
else if (S_ISDIR(s.st_mode))
|
||||||
@ -208,7 +210,7 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
rump_sys_lseek(_fd, 0, SEEK_SET);
|
rump_sys_lseek(_fd, 0, SEEK_SET);
|
||||||
|
|
||||||
int bytes;
|
int bytes;
|
||||||
vfs_dir->fileno = 0;
|
unsigned fileno = 0;
|
||||||
char *buf = _buffer();
|
char *buf = _buffer();
|
||||||
struct ::dirent *dent = nullptr;
|
struct ::dirent *dent = nullptr;
|
||||||
do {
|
do {
|
||||||
@ -220,7 +222,7 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
{
|
{
|
||||||
dent = (::dirent *)current;
|
dent = (::dirent *)current;
|
||||||
if (strcmp(".", dent->d_name) && strcmp("..", dent->d_name)) {
|
if (strcmp(".", dent->d_name) && strcmp("..", dent->d_name)) {
|
||||||
if (vfs_dir->fileno++ == index) {
|
if (fileno++ == index) {
|
||||||
Path newpath(dent->d_name, _path.base());
|
Path newpath(dent->d_name, _path.base());
|
||||||
return _finish_read(newpath.base(), dent, *vfs_dir);
|
return _finish_read(newpath.base(), dent, *vfs_dir);
|
||||||
}
|
}
|
||||||
@ -228,8 +230,7 @@ class Vfs::Rump_file_system : public File_system
|
|||||||
}
|
}
|
||||||
} while (bytes > 0);
|
} while (bytes > 0);
|
||||||
|
|
||||||
vfs_dir->type = DIRENT_TYPE_END;
|
*vfs_dir = Dirent();
|
||||||
vfs_dir->name[0] = '\0';
|
|
||||||
return READ_OK;
|
return READ_OK;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user