chiark / gitweb /
systemctl: use isolate when called as telinit for a runlevel
[elogind.git] / src / util.c
index a09b704ffebd1e2195a17b6b4a95fdab717afdb2..93f982e8bcabd07436ec5a3306cef12f311d2466 100644 (file)
@@ -1917,9 +1917,9 @@ int reset_terminal(int fd) {
 
         assert(fd >= 0);
 
-        /* First, unlock termios */
-        zero(termios);
-        ioctl(fd, TIOCSLCKTRMIOS, &termios);
+        /* We leave locked terminal attributes untouched, so that
+         * Plymouth may set whatever it wants to set, and we don't
+         * interfere with that. */
 
         /* Disable exclusive mode, just in case */
         ioctl(fd, TIOCNXCL);
@@ -2835,6 +2835,32 @@ void status_welcome(void) {
 
         status_printf("Welcome to \x1B[0;32m%s\x1B[0m!\n", r); /* Green for SUSE */
         free(r);
+
+#elif defined(TARGET_GENTOO)
+        char *r;
+
+        if (read_one_line_file("/etc/gentoo-release", &r) < 0)
+                return;
+
+        truncate_nl(r);
+
+        status_printf("Welcome to \x1B[1;34m%s\x1B[0m!\n", r); /* Light Blue for Gentoo */
+
+        free(r);
+
+#elif defined(TARGET_DEBIAN)
+       char *r;
+
+       if (read_one_line_file("/etc/debian_version", &r) < 0)
+               return;
+
+       truncate_nl(r);
+
+       status_printf("Welcome to Debian \x1B[1;31m%s\x1B[0m!\n", r); /* Light Red for Debian */
+
+       free(r);
+#elif defined(TARGET_ARCH)
+       status_printf("Welcome to \x1B[1;36mArch Linux\x1B[0m!\n"); /* Cyan for Arch */
 #else
 #warning "You probably should add a welcome text logic here."
 #endif
@@ -2988,7 +3014,7 @@ int columns(void) {
                 struct winsize ws;
                 zero(ws);
 
-                if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) >= 0)
+                if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) >= 0)
                         parsed_columns = ws.ws_col;
         }