|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From c600022303a10155f48a8eab59c6c0ae1b797699 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: David Herrmann <dh.herrmann@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Thu, 11 Sep 2014 15:28:37 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] terminal: enable sessions in evcat after taking control
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
If we enable a session, any probed device might get immediately enabled.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
This might cause TakeDevice() messages to be sent before we call
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
TakeControl(). Therefore, enable sessions *after* sending TakeControl() so
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
we always succeed if TakeControl() succeeds.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/evcat.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/evcat.c b/src/libsystemd-terminal/evcat.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 590a30d873..8c27fb2c54 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/evcat.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/evcat.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -313,8 +313,6 @@ static int evcat_sysview_fn(sysview_context *c, void *userdata, sysview_event *e
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- idev_session_enable(e->idev_session);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (e->managed) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r = sysview_session_take_control(ev->session_add.session);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -323,6 +321,8 @@ static int evcat_sysview_fn(sysview_context *c, void *userdata, sysview_event *e
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ idev_session_enable(e->idev_session);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
break;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
case SYSVIEW_EVENT_SESSION_REMOVE:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
idev_session_disable(e->idev_session);
|