diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2012-01-29 21:55:51 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2012-01-29 21:55:51 +0100 |
commit | 512947d46f9fd7daf74c059ac8548cc98b294807 (patch) | |
tree | ea73a2d9d0c7bf14000a9e3b892e9e5276870324 /src/util.c | |
parent | 9c07474c6fa296195dcdc734d77792dff95f5c35 (diff) |
main: don't force text mode in console_setup()
When systemd starts, plymouth may be already displaying progress
graphically. Do not switch the console to text mode at that time.
All other users of reset_terminal_fd() do the switch as before.
This avoids a graphical glitch with plymouth, especially visible with
vesafb, but could be also seen as a sub-second blink with radeon.
https://bugzilla.redhat.com/show_bug.cgi?id=785548
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/util.c b/src/util.c index 5fe22d2e50..ce7f1c9f84 100644 --- a/src/util.c +++ b/src/util.c @@ -2544,7 +2544,7 @@ int ask(char *ret, const char *replies, const char *text, ...) { } } -int reset_terminal_fd(int fd) { +int reset_terminal_fd(int fd, bool switch_to_text) { struct termios termios; int r = 0; @@ -2560,7 +2560,8 @@ int reset_terminal_fd(int fd) { ioctl(fd, TIOCNXCL); /* Switch to text mode */ - ioctl(fd, KDSETMODE, KD_TEXT); + if (switch_to_text) + ioctl(fd, KDSETMODE, KD_TEXT); /* Enable console unicode mode */ ioctl(fd, KDSKBMODE, K_UNICODE); @@ -2614,7 +2615,7 @@ int reset_terminal(const char *name) { if (fd < 0) return fd; - r = reset_terminal_fd(fd); + r = reset_terminal_fd(fd, true); close_nointr_nofail(fd); return r; @@ -2808,7 +2809,8 @@ int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocst if (notify >= 0) close_nointr_nofail(notify); - if ((r = reset_terminal_fd(fd)) < 0) + r = reset_terminal_fd(fd, true); + if (r < 0) log_warning("Failed to reset terminal: %s", strerror(-r)); return fd; |