chiark / gitweb /
login: simplify assignment
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 5 Jul 2015 16:02:20 +0000 (12:02 -0400)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:05:56 +0000 (10:05 +0100)
src/login/logind-dbus.c

index 659ce18a48869649bf3999f9832562f32b7a36b2..0cc2cdf997d3d45b9c3ea467e21ba69486368225 100644 (file)
@@ -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;