seat: allow calling go_foreground if already in foreground

If we are asleep and in foreground, go_foreground() should return success
so we can safely unload asynchronous sessions. Otherwise, we wouldn't be
able to handle them properly while being inactive or we would need a whole
bunch of other checks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-11-17 20:13:27 +01:00
parent c7707560de
commit 527a73120b

View File

@ -134,11 +134,9 @@ static int seat_go_foreground(struct kmscon_seat *seat)
{
int ret;
if (!seat->awake)
return -EBUSY;
if (seat->foreground)
return 0;
if (seat->current_sess)
if (!seat->awake || seat->current_sess)
return -EBUSY;
if (seat->cb) {