mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-23 17:17:38 +00:00
@ -86,12 +86,12 @@ struct Vfs::Directory_service
|
||||
|
||||
struct Stat
|
||||
{
|
||||
file_size size;
|
||||
unsigned mode;
|
||||
unsigned uid;
|
||||
unsigned gid;
|
||||
unsigned long inode;
|
||||
unsigned long device;
|
||||
file_size size = 0;
|
||||
unsigned mode = 0;
|
||||
unsigned uid = 0;
|
||||
unsigned gid = 0;
|
||||
unsigned long inode = 0;
|
||||
unsigned long device = 0;
|
||||
};
|
||||
|
||||
enum Stat_result { STAT_ERR_NO_ENTRY = NUM_GENERAL_ERRORS,
|
||||
@ -120,9 +120,9 @@ struct Vfs::Directory_service
|
||||
|
||||
struct Dirent
|
||||
{
|
||||
unsigned long fileno;
|
||||
Dirent_type type;
|
||||
char name[DIRENT_MAX_NAME_LEN];
|
||||
unsigned long fileno = 0;
|
||||
Dirent_type type = DIRENT_TYPE_END;
|
||||
char name[DIRENT_MAX_NAME_LEN] = { 0 };
|
||||
};
|
||||
|
||||
virtual Dirent_result dirent(char const *path, file_offset index, Dirent &) = 0;
|
||||
|
@ -255,7 +255,7 @@ class Vfs::Fs_file_system : public File_system
|
||||
catch (::File_system::Lookup_failed) { return STAT_ERR_NO_ENTRY; }
|
||||
catch (::File_system::Out_of_metadata) { return STAT_ERR_NO_PERM; }
|
||||
|
||||
memset(&out, 0, sizeof(out));
|
||||
out = Stat();
|
||||
|
||||
out.size = status.size;
|
||||
out.mode = STAT_MODE_FILE | 0777;
|
||||
|
@ -70,7 +70,7 @@ class Vfs::Single_file_system : public File_system
|
||||
|
||||
Stat_result stat(char const *path, Stat &out) override
|
||||
{
|
||||
out = { 0, 0, 0, 0, 0, 0 };
|
||||
out = Stat();
|
||||
out.device = (Genode::addr_t)this;
|
||||
|
||||
if (_root(path)) {
|
||||
|
@ -75,7 +75,7 @@ class Vfs::Symlink_file_system : public File_system
|
||||
|
||||
Stat_result stat(char const *path, Stat &out) override
|
||||
{
|
||||
out = { 0, 0, 0, 0, 0, 0 };
|
||||
out = Stat();
|
||||
out.device = (Genode::addr_t)this;
|
||||
|
||||
if (_root(path)) {
|
||||
|
@ -425,6 +425,8 @@ class Vfs::Tar_file_system : public File_system
|
||||
if (verbose)
|
||||
PDBG("path = %s", path);
|
||||
|
||||
out = Stat();
|
||||
|
||||
Node const *node = dereference(path);
|
||||
if (!node)
|
||||
return STAT_ERR_NO_ENTRY;
|
||||
@ -433,7 +435,6 @@ class Vfs::Tar_file_system : public File_system
|
||||
if (verbose)
|
||||
PDBG("found a virtual directoty node");
|
||||
|
||||
memset(&out, 0, sizeof(out));
|
||||
out.mode = STAT_MODE_DIRECTORY;
|
||||
return STAT_OK;
|
||||
}
|
||||
@ -452,7 +453,6 @@ class Vfs::Tar_file_system : public File_system
|
||||
PDBG("unhandled record type %d", record->type());
|
||||
}
|
||||
|
||||
memset(&out, 0, sizeof(out));
|
||||
out.mode = mode;
|
||||
out.size = record->size();
|
||||
out.uid = record->uid();
|
||||
|
Reference in New Issue
Block a user