chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7bc0351
)
util: reset terminal even harder
author
Lennart Poettering
<lennart@poettering.net>
Mon, 12 Jul 2010 19:40:43 +0000
(21:40 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 12 Jul 2010 19:40:43 +0000
(21:40 +0200)
src/util.c
patch
|
blob
|
history
diff --git
a/src/util.c
b/src/util.c
index b5513dd74c45174b74b3a8fad55ea719d3f08a18..e5d845609defb295e7e03f3dc087f3337f1c51f8 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-47,6
+47,7
@@
#include <sys/utsname.h>
#include <pwd.h>
#include <netinet/ip.h>
#include <sys/utsname.h>
#include <pwd.h>
#include <netinet/ip.h>
+#include <linux/kd.h>
#include "macro.h"
#include "util.h"
#include "macro.h"
#include "util.h"
@@
-1844,10
+1845,22
@@
int ask(char *ret, const char *replies, const char *text, ...) {
int reset_terminal(int fd) {
struct termios termios;
int r = 0;
int reset_terminal(int fd) {
struct termios termios;
int r = 0;
+ long arg;
+
+ /* Set terminal to some sane defaults */
assert(fd >= 0);
assert(fd >= 0);
- /* Set terminal to some sane defaults */
+ /* First, unlock termios */
+ zero(termios);
+ ioctl(fd, TIOCSLCKTRMIOS, &termios);
+
+ /* Disable exclusive mode, just in case */
+ ioctl(fd, TIOCNXCL);
+
+ /* Enable console unicode mode */
+ arg = K_UNICODE;
+ ioctl(fd, KDSKBMODE, &arg);
if (tcgetattr(fd, &termios) < 0) {
r = -errno;
if (tcgetattr(fd, &termios) < 0) {
r = -errno;