chiark / gitweb /
login: assing /dev/console logins to seat0
[elogind.git] / src / shared / util.c
index 43948ccbd8970c5076d2f00659d26f2d449fa4ce..def576de2130981cbc51ea64b74e2397f996949d 100644 (file)
@@ -4287,6 +4287,15 @@ bool tty_is_vc(const char *tty) {
         return vtnr_from_tty(tty) >= 0;
 }
 
         return vtnr_from_tty(tty) >= 0;
 }
 
+bool tty_is_console(const char *tty) {
+        assert(tty);
+
+        if (startswith(tty, "/dev/"))
+                tty += 5;
+
+        return streq(tty, "console");
+}
+
 int vtnr_from_tty(const char *tty) {
         int i, r;
 
 int vtnr_from_tty(const char *tty) {
         int i, r;