From cfba429c159468180296fc82dff46f6b0f3ee989 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 21 Nov 2019 11:20:39 +0100 Subject: [PATCH] vfs/rump: offer all files as read-writeable The distinction between read-only and read-writeable is the responsibility of the front end, i.e., the vfs server. --- repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc b/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc index 33c30c53e..8127a9134 100644 --- a/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc +++ b/repos/dde_rump/src/lib/vfs/rump/vfs_rump.cc @@ -194,7 +194,7 @@ class Vfs::Rump_file_system : public File_system * We cannot use 'd_type' member of 'dirent' here since the EXT2 * implementation sets the type to unkown. Hence we use stat. */ - struct stat s; + struct stat s { }; rump_sys_lstat(path, &s); auto dirent_type = [] (unsigned mode) @@ -209,8 +209,8 @@ class Vfs::Rump_file_system : public File_system return Dirent_type::END; }; - Node_rwx const rwx { .readable = (s.st_mode & S_IRUSR), - .writeable = (s.st_mode & S_IWUSR), + Node_rwx const rwx { .readable = true, + .writeable = true, .executable = (s.st_mode & S_IXUSR) }; vfs_dir = { @@ -699,7 +699,7 @@ class Vfs::Rump_file_system : public File_system Stat_result stat(char const *path, Stat &stat) { - struct stat sb; + struct stat sb { }; if (rump_sys_lstat(path, &sb) != 0) return STAT_ERR_NO_ENTRY; auto type = [] (unsigned mode) @@ -713,8 +713,8 @@ class Vfs::Rump_file_system : public File_system stat = { .size = (file_size)sb.st_size, .type = type(sb.st_mode), - .rwx = { .readable = (sb.st_mode & S_IRUSR), - .writeable = (sb.st_mode & S_IWUSR), + .rwx = { .readable = true, + .writeable = true, .executable = (sb.st_mode & S_IXUSR) }, .inode = sb.st_ino, .device = sb.st_dev,