diff --git a/repos/os/src/lib/vfs/log_file_system.h b/repos/os/src/lib/vfs/log_file_system.h index 757290fbf..8e5ba98ee 100644 --- a/repos/os/src/lib/vfs/log_file_system.h +++ b/repos/os/src/lib/vfs/log_file_system.h @@ -142,7 +142,7 @@ class Vfs::Log_file_system : public Single_file_system Genode::Xml_node config) : Single_file_system(Node_type::CONTINUOUS_FILE, name(), - Node_rwx::ro(), config), + Node_rwx::wo(), config), _label(config.attribute_value("label", Label())), _log(_log_session(env.env())) { } @@ -150,6 +150,7 @@ class Vfs::Log_file_system : public Single_file_system static const char *name() { return "log"; } char const *type() override { return "log"; } + /********************************* ** Directory service interface ** *********************************/ @@ -169,6 +170,20 @@ class Vfs::Log_file_system : public Single_file_system catch (Genode::Out_of_ram) { return OPEN_ERR_OUT_OF_RAM; } catch (Genode::Out_of_caps) { return OPEN_ERR_OUT_OF_CAPS; } } + + + /******************************* + ** File_io_service interface ** + *******************************/ + + Ftruncate_result ftruncate(Vfs_handle *, file_size) override + { + /* + * Return success to allow for output redirection via '> /dev/log'. + * The shell call ftruncate after opening the destination file. + */ + return FTRUNCATE_OK; + } }; #endif /* _INCLUDE__VFS__LOG_FILE_SYSTEM_H_ */