summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-05 12:02:20 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-05 12:02:20 -0400
commitde7de280b5eae7206c35e869e7d5bcd3d6a18c22 (patch)
treeda41aaa6419771a56cba9ed81af5aa31d0501a7a
parent604f02add68c10232876a868c2f04b77cdcefee0 (diff)
login: simplify assignment
-rw-r--r--src/login/logind-dbus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 659ce18a48..0cc2cdf997 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -690,8 +690,8 @@ static int method_create_session(sd_bus_message *message, void *userdata, sd_bus
}
manager_get_session_by_pid(m, leader, &session);
- if (!session && vtnr > 0)
- session = (vtnr < m->seat0->position_count) ? m->seat0->positions[vtnr] : NULL;
+ if (!session && vtnr > 0 && vtnr < m->seat0->position_count)
+ session = m->seat0->positions[vtnr];
if (session) {
_cleanup_free_ char *path = NULL;
_cleanup_close_ int fifo_fd = -1;