aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/chan_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/chan_user.c')
-rw-r--r--arch/um/drivers/chan_user.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 8443d372f67c..b88e93b3a39f 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -82,17 +82,21 @@ int generic_console_write(int fd, const char *buf, int n)
82 if (err) 82 if (err)
83 goto error; 83 goto error;
84 new = save; 84 new = save;
85 /* The terminal becomes a bit less raw, to handle \n also as 85 /*
86 * The terminal becomes a bit less raw, to handle \n also as
86 * "Carriage Return", not only as "New Line". Otherwise, the new 87 * "Carriage Return", not only as "New Line". Otherwise, the new
87 * line won't start at the first column.*/ 88 * line won't start at the first column.
89 */
88 new.c_oflag |= OPOST; 90 new.c_oflag |= OPOST;
89 CATCH_EINTR(err = tcsetattr(fd, TCSAFLUSH, &new)); 91 CATCH_EINTR(err = tcsetattr(fd, TCSAFLUSH, &new));
90 if (err) 92 if (err)
91 goto error; 93 goto error;
92 } 94 }
93 err = generic_write(fd, buf, n, NULL); 95 err = generic_write(fd, buf, n, NULL);
94 /* Restore raw mode, in any case; we *must* ignore any error apart 96 /*
95 * EINTR, except for debug.*/ 97 * Restore raw mode, in any case; we *must* ignore any error apart
98 * EINTR, except for debug.
99 */
96 if (isatty(fd)) 100 if (isatty(fd))
97 CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save)); 101 CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save));
98 return err; 102 return err;
@@ -167,13 +171,13 @@ static int winch_thread(void *arg)
167 exit(1); 171 exit(1);
168 } 172 }
169 173
170 if(ioctl(pty_fd, TIOCSCTTY, 0) < 0){ 174 if (ioctl(pty_fd, TIOCSCTTY, 0) < 0) {
171 printk(UM_KERN_ERR "winch_thread : TIOCSCTTY failed on " 175 printk(UM_KERN_ERR "winch_thread : TIOCSCTTY failed on "
172 "fd %d err = %d\n", pty_fd, errno); 176 "fd %d err = %d\n", pty_fd, errno);
173 exit(1); 177 exit(1);
174 } 178 }
175 179
176 if(tcsetpgrp(pty_fd, os_getpid()) < 0){ 180 if (tcsetpgrp(pty_fd, os_getpid()) < 0) {
177 printk(UM_KERN_ERR "winch_thread : tcsetpgrp failed on " 181 printk(UM_KERN_ERR "winch_thread : tcsetpgrp failed on "
178 "fd %d err = %d\n", pty_fd, errno); 182 "fd %d err = %d\n", pty_fd, errno);
179 exit(1); 183 exit(1);