]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
login/pam_systemd: drop redundant vtnr == 0 handling
authorMike Yuan <me@yhndnzj.com>
Sat, 25 Jan 2025 21:32:16 +0000 (22:32 +0100)
committerMike Yuan <me@yhndnzj.com>
Sun, 26 Jan 2025 03:15:41 +0000 (04:15 +0100)
vtnr_from_tty() treats 0 as invalid.

src/login/pam_systemd.c

index e97485e9c93c639ff4d41b69d7f610095c0e3928..ffca6045b67fbb48d8b08d4a9de8ff3f1e460580 100644 (file)
@@ -348,8 +348,7 @@ static int get_seat_from_display(const char *display, const char **seat, uint32_
         v = vtnr_from_tty(tty);
         if (v < 0)
                 return v;
-        else if (v == 0)
-                return -ENOENT;
+        assert(v > 0);
 
         if (seat)
                 *seat = "seat0";