summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c9
1 files changed, 9 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;