diff --git a/repos/base/src/lib/base/child.cc b/repos/base/src/lib/base/child.cc
index cc8daf4ee..c16d43a6d 100644
--- a/repos/base/src/lib/base/child.cc
+++ b/repos/base/src/lib/base/child.cc
@@ -533,8 +533,17 @@ void Child::session_response(Server::Id id, Session_response response)
case Parent::SESSION_CLOSED:
session.phase = Session_state::CLOSED;
+
+ /*
+ * If the client exists, reflect the response to the client
+ * via the 'closed_callback'. If the client has vanished,
+ * i.e., if the close request was issued by ourself while
+ * killing a child, we drop the session state immediately.
+ */
if (session.closed_callback)
session.closed_callback->session_closed(session);
+ else
+ _revert_quota_and_destroy(session);
break;
case Parent::INVALID_ARGS:
diff --git a/repos/os/run/init.run b/repos/os/run/init.run
index e0de4e040..57aaa063f 100644
--- a/repos/os/run/init.run
+++ b/repos/os/run/init.run
@@ -92,6 +92,12 @@ append config {
+
+
@@ -121,7 +127,10 @@ append config {
-
+
+
+
+
@@ -177,7 +186,10 @@ append config {
-
+
+
+
+
@@ -199,6 +211,44 @@ append config {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/repos/os/src/test/init/main.cc b/repos/os/src/test/init/main.cc
index 83f6c1319..162fc9a4d 100644
--- a/repos/os/src/test/init/main.cc
+++ b/repos/os/src/test/init/main.cc
@@ -91,6 +91,9 @@ static inline bool Test::xml_matches(Xml_node expected, Xml_node node)
matches = matches && at_least_one_sub_node_matches;
}
+
+ if (condition.type() == "not")
+ matches = matches && !xml_matches(condition, node);
});
return matches;
}