diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-07-05 12:02:20 -0400 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-14 10:05:56 +0100 |
commit | 093cf10b14f9e6b101927a8e356def54391c5d65 (patch) | |
tree | 5457c44c3b55cc5fa70c0088fd262296a9da5d01 /src/login | |
parent | 260ec60412d6488016a39c8f8ee58273e2514ab1 (diff) |
login: simplify assignment
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-dbus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 659ce18a4..0cc2cdf99 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; |