From c8322ffd2ab7346eae2197540b9ecae27045aced Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 17 Jun 2020 14:52:27 +0200 Subject: [PATCH] decorator: fix cap-upgrade handling This commit fixes the 'Out_of_caps' handling. The previous version mistakenly upgraded the RAM instead the caps as response. The problem could be triggered by the 'decorator_stress.run' script. --- repos/gems/run/decorator_stress.run | 6 +++++- repos/gems/src/app/decorator/main.cc | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/repos/gems/run/decorator_stress.run b/repos/gems/run/decorator_stress.run index 09b67ecef5..5a7c76857b 100644 --- a/repos/gems/run/decorator_stress.run +++ b/repos/gems/run/decorator_stress.run @@ -9,6 +9,7 @@ import_from_depot [depot_user]/src/[base_src] \ [depot_user]/src/decorator \ [depot_user]/src/libc \ [depot_user]/src/libpng \ + [depot_user]/src/vfs \ [depot_user]/src/zlib install_config { @@ -82,8 +83,11 @@ install_config { - + + + + diff --git a/repos/gems/src/app/decorator/main.cc b/repos/gems/src/app/decorator/main.cc index 8070c7b278..dd649bb5d2 100644 --- a/repos/gems/src/app/decorator/main.cc +++ b/repos/gems/src/app/decorator/main.cc @@ -183,7 +183,7 @@ struct Decorator::Main : Window_factory_base */ Window_base *create(Xml_node window_node) override { - for (unsigned retry = 0 ; retry < 2; retry ++) { + for (;;) { try { return new (_heap) Window(window_node.attribute_value("id", 0UL), @@ -195,7 +195,7 @@ struct Decorator::Main : Window_factory_base } catch (Genode::Out_of_caps) { Genode::log("Handle Out_of_caps of nitpicker session - upgrade by 2"); - _nitpicker.upgrade_ram(2); + _nitpicker.upgrade_caps(2); } } return nullptr;