X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fgetty-generator.c;h=7b91094b313b6be4527d30379b231a5a11a13b0e;hb=c375a7f750d0ac3ab130b8d84ebbcbbf32b96c72;hp=f49f9eae99df54a108659064157932bfb939df4d;hpb=2a796654b9a1f84962e5dafbcf171dcc22742c99;p=elogind.git diff --git a/src/getty-generator.c b/src/getty-generator.c index f49f9eae9..7b91094b3 100644 --- a/src/getty-generator.c +++ b/src/getty-generator.c @@ -86,7 +86,6 @@ int main(int argc, char *argv[]) { if (read_one_line_file("/sys/class/tty/console/active", &active) >= 0) { const char *tty; - truncate_nl(active); if ((tty = strrchr(active, ' '))) tty ++; else @@ -116,10 +115,18 @@ int main(int argc, char *argv[]) { /* Automatically add in a serial getty on the first * virtualizer console */ if (access("/sys/class/tty/hvc0", F_OK) == 0) { - log_debug("Automatic adding serial getty for hvc0."); + log_debug("Automatically adding serial getty for hvc0."); if (add_symlink("serial-getty@.service", "serial-getty@hvc0.service") < 0) r = EXIT_FAILURE; + + } + + if (access("/sys/class/tty/xvc0", F_OK) == 0) { + log_debug("Automatically adding serial getty for xvc0."); + + if (add_symlink("serial-getty@.service", "serial-getty@xvc0.service") < 0) + r = EXIT_FAILURE; } finish: