summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@serenityos.org>2020-05-28 18:03:58 +0300
committerAndreas Kling <kling@serenityos.org>2020-05-29 07:53:30 +0200
commit4b300e085d3fcad038b180ab90a9546bdfcc1335 (patch)
tree5c123b7077c2e3b0765d695a96273fceab7a6736 /Applications
parentfdb71cdf8fa6c48b226e2242fbfdd75216e2f442 (diff)
downloadserenity-4b300e085d3fcad038b180ab90a9546bdfcc1335.zip
Userland+SystemMonitor: Recognize the MS_RDONLY mount flag
Diffstat (limited to 'Applications')
-rw-r--r--Applications/SystemMonitor/main.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp
index 9bf95ca2dc..914fef186a 100644
--- a/Applications/SystemMonitor/main.cpp
+++ b/Applications/SystemMonitor/main.cpp
@@ -78,7 +78,7 @@ static NonnullRefPtr<GUI::Widget> build_graphs_tab();
class UnavailableProcessWidget final : public GUI::Frame {
C_OBJECT(UnavailableProcessWidget)
public:
- virtual ~UnavailableProcessWidget() override {}
+ virtual ~UnavailableProcessWidget() override { }
const String& text() const { return m_text; }
void set_text(String text) { m_text = move(text); }
@@ -285,7 +285,7 @@ int main(int argc, char** argv)
class ProgressBarPaintingDelegate final : public GUI::TableCellPaintingDelegate {
public:
- virtual ~ProgressBarPaintingDelegate() override {}
+ virtual ~ProgressBarPaintingDelegate() override { }
virtual void paint(GUI::Painter& painter, const Gfx::Rect& a_rect, const Palette& palette, const GUI::Model& model, const GUI::ModelIndex& index) override
{
@@ -357,7 +357,9 @@ NonnullRefPtr<GUI::Widget> build_file_systems_tab()
return object.get("free_block_count").to_u32() * object.get("block_size").to_u32();
});
df_fields.empend("Access", Gfx::TextAlignment::CenterLeft, [](const JsonObject& object) {
- return object.get("readonly").to_bool() ? "Read-only" : "Read/Write";
+ bool readonly = object.get("readonly").to_bool();
+ int mount_flags = object.get("mount_flags").to_int();
+ return readonly || (mount_flags & MS_RDONLY) ? "Read-only" : "Read/Write";
});
df_fields.empend("Mount flags", Gfx::TextAlignment::CenterLeft, [](const JsonObject& object) {
int mount_flags = object.get("mount_flags").to_int();
@@ -375,6 +377,7 @@ NonnullRefPtr<GUI::Widget> build_file_systems_tab()
check(MS_NOEXEC, "noexec");
check(MS_NOSUID, "nosuid");
check(MS_BIND, "bind");
+ check(MS_RDONLY, "ro");
if (builder.string_view().is_empty())
return String("defaults");
return builder.to_string();