summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-09-11 15:28:37 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2014-09-11 15:28:37 +0200
commitc600022303a10155f48a8eab59c6c0ae1b797699 (patch)
tree5671d3d82eee95eef032b2e3ce50a3675fb23b63
parent1f3752c81ad5d746f90db751425c39c3ed0970ab (diff)
terminal: enable sessions in evcat after taking control
If we enable a session, any probed device might get immediately enabled. This might cause TakeDevice() messages to be sent before we call TakeControl(). Therefore, enable sessions *after* sending TakeControl() so we always succeed if TakeControl() succeeds.
-rw-r--r--src/libsystemd-terminal/evcat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-terminal/evcat.c b/src/libsystemd-terminal/evcat.c
index 590a30d873..8c27fb2c54 100644
--- a/src/libsystemd-terminal/evcat.c
+++ b/src/libsystemd-terminal/evcat.c
@@ -313,8 +313,6 @@ static int evcat_sysview_fn(sysview_context *c, void *userdata, sysview_event *e
return r;
}
- idev_session_enable(e->idev_session);
-
if (e->managed) {
r = sysview_session_take_control(ev->session_add.session);
if (r < 0) {
@@ -323,6 +321,8 @@ static int evcat_sysview_fn(sysview_context *c, void *userdata, sysview_event *e
}
}
+ idev_session_enable(e->idev_session);
+
break;
case SYSVIEW_EVENT_SESSION_REMOVE:
idev_session_disable(e->idev_session);