summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-04-22 02:30:13 +0200
committerLennart Poettering <lennart@poettering.net>2012-04-22 02:41:18 +0200
commitd1122ad5e3222cc17bfb556c23273598a5fb60fa (patch)
tree0deb6b39eb1130939d2ea27c06f02b878dd5e339 /src/shared
parent337eebb936be1da1215535e866965ce54c82d755 (diff)
login: assing /dev/console logins to seat0
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.c9
-rw-r--r--src/shared/util.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 43948ccbd8..def576de21 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -4287,6 +4287,15 @@ bool tty_is_vc(const char *tty) {
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;
diff --git a/src/shared/util.h b/src/shared/util.h
index 76bc7b3572..35ba0057d6 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -415,6 +415,7 @@ char *fstab_node_to_udev_node(const char *p);
bool tty_is_vc(const char *tty);
bool tty_is_vc_resolve(const char *tty);
+bool tty_is_console(const char *tty);
int vtnr_from_tty(const char *tty);
const char *default_term_for_tty(const char *tty);