chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
login: assing /dev/console logins to seat0
[elogind.git]
/
src
/
shared
/
util.c
diff --git
a/src/shared/util.c
b/src/shared/util.c
index 43948ccbd8970c5076d2f00659d26f2d449fa4ce..def576de2130981cbc51ea64b74e2397f996949d 100644
(file)
--- 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;
}
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;