mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-11 15:33:04 +00:00
platform_drv: fix update_policy()
The method did not handle device changes properly. When a new policy does not contain an owned device any more, we must consider this device as changed and release it. Moreover, the warning messages were interchanged. genodelabs/genode#4761
This commit is contained in:
parent
475bcfc2b9
commit
3520492f09
@ -84,13 +84,13 @@ void Session_component::update_policy(bool info, Policy_version version)
|
|||||||
_devices.for_each([&] (Device const & dev) {
|
_devices.for_each([&] (Device const & dev) {
|
||||||
if (dev.name() != dc.device())
|
if (dev.name() != dc.device())
|
||||||
return;
|
return;
|
||||||
state = (dev.owner() == _owner_id) ? UNCHANGED : CHANGED;
|
state = (dev.owner() == _owner_id && matches(dev)) ? UNCHANGED : CHANGED;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (state == UNCHANGED)
|
if (state == UNCHANGED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (state == AWAY)
|
if (state == CHANGED)
|
||||||
warning("Device ", dc.device(),
|
warning("Device ", dc.device(),
|
||||||
" has changed, will close device session");
|
" has changed, will close device session");
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user